【二维数组$a】
$a= array(
0 =>array(
‘id’ => ‘1’
),
1 =>array(
’id‘ =>‘2’
),
2 =>array(
‘id’ => ‘3’
)
);
【二维数组$b】
$b= array(
0 =>array(
’uid‘ => ‘1’
),
1 =>array(
‘uid’ => ‘2’
));
//把$a里id值和$b的uid值相同的数组删除
foreach($a as $key => $valueA){
$id = $valueA[‘id’];
foreach($b as $keys => $valueB){
if($id == $valueB[‘uid’]){
unset($a[$key]);
}
}
}
print_r($a);