我已经为此苦战了很久。
我有一个数组:
$url_array
它包含以下信息:
Array (
[ppp] => Array (
[0] => stdClass Object (
[id] => 46660
[entity_id] => 0
[redirect_url] => http://www.google.com
[type] => Image
)
[1] => stdClass Object (
[id] => 52662
[entity_id] => 0
[pixel_redirect_url] => http://www.yahoo.com
[type] => Image
)
[2] => stdClass Object (
[id] => 53877
[entity_id] => 0
[redirect_url] => http://www.msn.com
[pixel_type] => Image
)
)
[total_count] => 3
)
我需要循环遍历它,并对每个变量执行操作。 我可以让它工作:
foreach ($piggies_array as $key => $value) {
$id = $value[0]->id;
$redirect_url = $value[0]->redirect_url; }
毫不意外地,它只回显这些变量的第一个值,但无论我尝试什么,都无法让它循环遍历:
$value->redirect_url;
$value=>redirect_url;
我需要帮助,非常感谢。
$url_array
还是$url_array['ppp']
? - Linus Kleen