思路:遍历二维数组,合并两个二维数组的值,赋值给新数组
function mergeArray($arr1,$arr2){ $newArr = []; foreach($arr1 as $v1){ foreach ($arr2 as $v2) { $newArr[] = array_merge($v1,$v2); } } return $newArr; }
原创文章,作者:wure,如若转载,请注明出处:https://blog.ytso.com/273243.html
思路:遍历二维数组,合并两个二维数组的值,赋值给新数组
function mergeArray($arr1,$arr2){ $newArr = []; foreach($arr1 as $v1){ foreach ($arr2 as $v2) { $newArr[] = array_merge($v1,$v2); } } return $newArr; }
原创文章,作者:wure,如若转载,请注明出处:https://blog.ytso.com/273243.html