例如,我在 twitter 的 user_timeline 中返回了这些对象的数组。该对象如下所示:
[{"created_at": "Fri Nov 02 23:44:11 +0000 2012", "id": 264513266083049472, "id_str": "264513266083049472", "text": "@JessLeighMusic do it! This time my dad will be playing!", "source": "\u003ca href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\"\u003eTwitter for iPhone\u003c\/a\u003e", "truncated": false, "in_reply_to_status_id": 264489640013217793, "in_reply_to_status_id_str": "264489640013217793", "in_reply_to_user_id": 38814642, "in_reply_to_user_id_str": "38814642", "in_reply_to_screen_name": "JessLeighMusic", "user": {
"id": 143161594,
"id_str": "143161594",
"name": "Mandala Faulkner",
"screen_name": "Mandalastar",
"location": "Ada, Ok",
"description": "I love to sing, play guitar, piano, and flute, but I am still learning everyday. I perform at the Quality Inn the first and third Friday of every month.",
"url": null,
"entities": {
"description": {
"urls": []
}
},
等等等等。这是我的问题:在 PHP 中使用 foreach 时,如何指示代码“深入”到每个 {} 集中的元素?我以前从未使用过 JSON 对象,而且 Twitter 的 API 文档很糟糕。