我有这种数组:
Array ( [data] => Array ( [0] => Array ( [name] => Lskdjlkdsfj [start_time] => 2013-06-12 [timezone] => Europe/Rome [location] => Rome, Lazio [id] => 592087844156650 [rsvp_status] => attending ) ) [paging] => Array ( [previous] => https://graph.facebook.com/100004042705860/events?limit=25&since=1370995200&__paging_token=592087844156650&__previous=1 [next] => https://graph.facebook.com/100004042705860/events?limit=25&until=1370995200&__paging_token=592087844156650 ) )
要获取我正在这样做的数据:
foreach ($fb_events as $data) {
foreach ($data as $fb_event_data) {
echo $fb_event_data['name'];
echo $fb_event_data['start_time'];
}
}
这是使用双 foreach 的最佳方法吗?有没有更好的方法来循环进入数组的数组?这个正在工作。我只是想知道我是否以“正确”的方式做事!