我有这样的数组。该数组是动态创建的
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
)
)
)
)
我需要做的是使用 2foreach
或 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 是数据 NotUploading 的 0 索引日期和电池问题的 0 索引日期。基本上我需要比较每个值和其他东西,但我不能得到每个日期值。
原谅我的无知,但我尝试了很多:(