0
$A = ["0" => "a", "1" => "b", "2" => "c"];
$B = ["0" => "aa", "1" => "bb", "2" => "cc"]
array_walk($A,function($item) use($B){
     $temp[] = $item;
     $temp[] = $B[?];
});

怎么填?以上?如何获取array_walk中的当前索引?

4

1 回答 1

2

如果我理解正确的话,这样的事情会奏效

$A = ["0" => "a", "1" => "b", "2" => "c"];
$B = ["0" => "aa", "1" => "bb", "2" => "cc"]
array_walk($A,function($item, $key) use($B){
     $temp[] = $item;
     $temp[] = $B[$key];
});
于 2016-09-07T07:29:53.843 回答