$a = array(
array("id"=> "1","name"=> "aaa","switch"=> "on"),
array("id"=> "2","name"=> "aaa","switch"=> "on"),
array("id"=> "3","name"=> "aaa","switch"=> "on"),
array("id"=> "4","name"=> "aaa","switch"=> "on"),
);
$b = array(
array("aid"=> "1","list"=> "0","add"=> 1),
array("aid"=> "2","list"=> "1","add"=> 0),
array("aid"=> "3","list"=> "0","add"=> 1),
);
$temp = array_column($a, 'id');
foreach ($b as $k => $v){
$index = array_search($v['aid'], $temp);
$index && $a[$index] = array_merge($a[$index],$v);
}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!