标签:
$a = Array( Array( ‘wanjiaid‘ => ‘2‘, ‘address‘ => ‘发生到了附近的‘, ‘mobile‘ => ‘15810444878‘, ‘user_name‘ => ‘王佳琳‘, ), array( ‘wanjiaid‘=>‘3‘, ‘address‘ => ‘发生到了附近的‘, ‘mobile‘ => ‘15810444878‘, ‘user_name‘ => ‘王佳琳‘, ), array( ‘wanjiaid‘=>‘4‘, ‘address‘ => ‘发生到了附近的2‘, ‘mobile‘ => ‘15424887895‘, ‘user_name‘ => ‘王佳琳1‘, ), array( ‘wanjiaid‘=>‘5‘, ‘address‘ => ‘发生到了附近的2‘, ‘mobile‘ => ‘15810444878‘, ‘user_name‘ => ‘王佳琳2‘, ), array( ‘wanjiaid‘=>‘6‘, ‘address‘ => ‘山东福彩‘, ‘mobile‘ => ‘12548888888‘, ‘user_name‘ => ‘王佳琳3‘, ), ); $res = array(); $st = array( ‘address‘ => array(), ‘mobile‘ => array(), ‘user_name‘ => array(), ); foreach($a as $t) { $flag = true; foreach($st as $k=>$v) { if(in_array($t[$k], $v)) $flag = false; $st[$k][] = $t[$k]; } if($flag) $res[] = $t; } print_r($res);
标签:
原文地址:http://www.cnblogs.com/legendyang/p/5702930.html