Array( [IsSuccesfull] => 1 [Results] => Array ( [SingleResul] => Array ( [0] => Array ( [QueryId] => 100093 [PathId] => 1 [SourceFolder] => 1111111 ) [1] => Array ( [QueryId] => 100093 [PathId] => 2 [SourceFolder] => 1111 ) ) ))
你想怎么输出??
想输出QueryId、PathId、SourceFolder,然后QueryId重复的话只输出第一个,求大神指点。
假设 $t 是你的数组
$ar=array();foreach($t['Results']['SingleResul'] as $v){ if(!isset($ar[$v['QueryId']])){ $ar[$v['QueryId']]=$v; }}foreach($ar as $v) echo join(' | ' , $v)."<br>";
非常感谢jordan102大牛!
假设 $t 是你的数组
$ar=array();foreach($t['Results']['SingleResul'] as $v){ if(!isset($ar[$v['QueryId']])){ $ar[$v['QueryId']]=$v; }}foreach($ar as $v) echo join(' | ' , $v)."<br>";