0
好吧,我使用codebird來讀寫使用php的推文。這是一個受保護的Twitter帳戶,因此我需要使用API在我們的專用網絡上顯示推文。我能夠在沒有問題的情況下發布推文,它正在檢索我正在努力的自己的推文。codebird array顯示使用api的推文
$reply = (array) $cb->statuses_homeTimeline();
print_r($reply);
這使輸出(這僅僅是數組中的第一個)
Array ([0] => stdClass Object ([created_at] => Thu Feb 06 09:08:43 +0000 2014 [id] => 431353751824134144 [id_str] => 431353751824134144 [text] => test 3 [source] => web [truncated] => [in_reply_to_status_id] => [in_reply_to_status_id_str] => [in_reply_to_user_id] => [in_reply_to_user_id_str] => [in_reply_to_screen_name] => [user] => stdClass Object ([id] => 2292936619 [id_str] => 2292936619 [name] => JPress Support [screen_name] => JPressSupport [location] => [description] => This is an automated account letting you know of any issues. Any tweets made to the account will not be seen. Thanks, Johnston Press IT. [url] => [entities] => stdClass Object ([description] => stdClass Object ([urls] => Array ())) [protected] => 1 [followers_count] => 1 [friends_count] => 0 [listed_count] => 0 [created_at] => Wed Jan 15 16:11:20 +0000 2014 [favourites_count] => 0 [utc_offset] => 0 [time_zone] => Casablanca [geo_enabled] => [verified] => [statuses_count] => 3 [lang] => en-gb [contributors_enabled] => [is_translator] => [is_translation_enabled] => [profile_background_color] => C0DEED [profile_background_image_url] => http://abs.twimg.com/images/themes/theme1/bg.png [profile_background_image_url_https] => https://abs.twimg.com/images/themes/theme1/bg.png [profile_background_tile] => [profile_image_url] => http://pbs.twimg.com/profile_images/423490507906359297/t-ECTyZW_normal.png [profile_image_url_https] => https://pbs.twimg.com/profile_images/423490507906359297/t-ECTyZW_normal.png [profile_link_color] => 0084B4 [profile_sidebar_border_color] => C0DEED [profile_sidebar_fill_color] => DDEEF6 [profile_text_color] => 333333 [profile_use_background_image] => 1 [default_profile] => 1 [default_profile_image] => [following] => [follow_request_sent] => [notifications] =>) [geo] => [coordinates] => [place] => [contributors] => [retweet_count] => 0 [favorite_count] => 0 [entities] => stdClass Object ([hashtags] => Array () [symbols] => Array () [urls] => Array () [user_mentions] => Array ()) [favorited] => [retweeted] => [lang] => et)
但是,如果我這樣做
<? echo $reply[0]; ?>
它沒有給輸出。我猜這是簡單的,但我不能解決它,請任何人都可以幫助,我只需要在位[text] =>
請使用下一次'print_r'來獲取數組的格式化輸出並將其發佈。單行數組很難讀取。 – CSchulz
這是來自print_r,這就是爲什麼我掙扎,它沒有做任何格式化,我從來沒有見過這些對象之前 – Maff
但是你沒有從源代碼視圖複製它? – CSchulz