时间:2021-07-01 10:21:17 帮助过:24人阅读
贴出经var_export() 运行后的数组出来
$last = 0;foreach($a as $r) { foreach($r as $v) { if($last != $v['sid']) echo $v['sid']; $last = $v['sid']; }}
array ( 0 => array ( 'logo' => array ( 'id' => 1, 'sid' => 6, ), ), 1 => array ( 'logo' => array ( 'id' => 2, 'sid' => 6, ), ), )
$res = array();foreach($a as $v){ if(!isset($res[$v['logo']['sid']])) $res[$v['logo']['sid']] = $v;}print_r(array_values($res));
$last = 0;foreach($a as $r) { foreach($r as $v) { if($last != $v['sid']) echo $v['sid']; $last = $v['sid']; }}
$res = array();foreach($a as $v){ if(!isset($res[$v['logo']['sid']])) $res[$v['logo']['sid']] = $v;}print_r(array_values($res));