我有這樣的數組。該陣列是動態創建如何迭代多維數組?
Array
(
[Data NotUploading] => Array
(
[items] => Array
(
[0] => Array
(
[date] => 2013-04-02
[issue_id] => 1
[phone_service_device] => A
[phone_service_model] =>
[phone_service_os] =>
[phone_service_version] =>
[issue_name] => Data NotUploading
)
[1] => Array
(
[date] => 2013-04-02
[issue_id] => 1
[phone_service_device] => I
[phone_service_model] =>
[phone_service_os] =>
[phone_service_version] =>
[issue_name] => Data NotUploading
)
)
)
[Battery Problem] => Array
(
[items] => Array
(
[0] => Array
(
[date] => 2013-04-03
[issue_id] => 3
[phone_service_device] => I
[phone_service_model] =>
[phone_service_os] =>
[phone_service_version] =>
[issue_name] => Battery Problem
)
)
)
)
我需要做的是使用2 foreach
或1的foreach & 1 for循環,這樣我可以得到最新的每個值我不喜歡這個
foreach($gResultbyName as $key1 => $rec){
for($j = 0;$j<count($rec);$j++){
echo $rec['items'][$j]['date'];
}
}
但其唯一檢索2013-04-02 & 2013-04-03即0索引數據日期NotUploading & 0電池問題索引日期。基本上我需要比較每個值和其他的東西,但我不能得到每個日期值。
請原諒我的無知,但我嘗試了很多:(