從多維數組中獲取數組中所有數據的正確方法是什麼?在多維數組中返回數組數據的正確方法?
Array
(
[0]Array
(
[0] Array
(
[day] 3/1/2016
[start1] 12:15am
[end1] 1:15am
[start2]
[end2]
)
[1] Array
(
[day] 3/2/2016
[start1] 12:00am
[end1] 1:00am
[start2]
[end2]
)
[2] Array
(
[day] 3/3/2016
[start1] 12:00am
[end1] 12:00am
[start2]
[end2]
)
)
)
我想遍歷並獲取每個嵌套數組的所有信息,但我似乎遇到未定義的索引錯誤。
foreach($timeArray as $day){
echo "Day: " + $day['day'] + "Start1: " + $day['start1'] + "End1: " + $day['end1'] + "Start2: " + $day['start2'] +"End2: " + $day['end2'];
}
對不起,我讓我的JS和PHP現在混在一起。需要睡眠大聲笑 – tai