/* * PHP按值合并数组 * */ function my_array_merge(&$array1, &$array2) { $result = Array(); foreach($array1 as $key => &$value) { $result[$key] = array_merge($value, $array2[$key]); } return $result; }
时间: 2024-10-10 10:40:26
/* * PHP按值合并数组 * */ function my_array_merge(&$array1, &$array2) { $result = Array(); foreach($array1 as $key => &$value) { $result[$key] = array_merge($value, $array2[$key]); } return $result; }