0
Array
(
    [statuses] => Array
        (
            [0] => Array
                (
                    [metadata] => Array
                        (
                            [result_type] => recent
                            [iso_language_code] => en
                        )

                    [created_at] => Wed Jul 30 17:15:35 +0000 2013
                    [id] => 3626225823751905
                    [id_str] => 3626225875190528
                    [text] =>Where are you?

                     [user] => Array
                        (
                            [id] => 192994
                            [id_str] => 192994
                            [name] => Stupido
                            [screen_name] => Stupido
                            [location] => 
                            [description] =>I'm who I'm
                            [url] => http://t.co/xehevCed
                            [entities] => Array
                                (
                                    [url] => Array
                                        (
                                            [urls] => Array
                                                (
                                                    [0] => Array
                                                        (
                                                            [url] => http://t.co/xehevCed

所以,我有我最近的 20 条推文 - JSON_decode() :但是,我怎样才能真正检索文本和 URL?它的嵌套数组。

有人可以帮忙吗?

4

1 回答 1

0

你在使用亚伯拉罕 Twitteroauth 吗?

尝试这个:

$parameters = array('screen_name' => 'twitter' /* your screen name */, 'result_type' => 'recent', 'count' => '20' /* your limit */  );

$content = $connection->get("statuses/user_timeline", $parameters);

for($i = 0; $i < 20 /* your limit */; ++$i) {

echo $content[$i]->text . $content[$i]->user->url . "<hr />";

}
于 2013-07-31T20:49:32.463 回答