Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I output the content of this array from the twitter API?
    primarykey
    data
    text
    <p>Ok , so I made a call to the Twitter API to return the statuses of my friends , I did a var_dump and it returned an array of the info .. However , I would only like to catch the PROFILE IMAGEs of my friends .. So this is what I did to catch it and it does not return anything</p> <pre><code>$friends = $connection-&gt;get('statuses/friends_timeline'); //method that catches my friends'statuses on Twitter. var_dump($friends); </code></pre> <p>The loop below is supposed to display the images of my friends .. Below the loop is the sample of what the var_dump returned to me .. Where am I going wrong ???</p> <pre><code>if( is_array($friends)) { shuffle($friends); } for($i=0; $i &lt;=count($friends);$i++) if (is_array($friends)) { foreach ($friends[$i] as $key =&gt; $value) { if(array_key_exists("profile_image_url", $friends[$i])) { echo "&lt;img src='". $value."' width='100' height='100'/&gt;"; } } } array(20) { [0]=&gt; object(stdClass)#7 (19) { ["id_str"]=&gt; string(18) "277310503989149697" ["user"]=&gt; object(stdClass)#8 (37) { ["id"]=&gt; int(48948037) ["default_profile"]=&gt; bool(false) ["following"]=&gt; bool(false) ["profile_background_tile"]=&gt; bool(true) ["id_str"]=&gt; string(8) "48948037" ["url"]=&gt; NULL ["profile_sidebar_fill_color"]=&gt; string(6) "CCD7DB" ["profile_image_url"]=&gt; string(66) "http://a0.twimg.com/profile_images/1821098433/photo__1__normal.JPG" ["utc_offset"]=&gt; int(-28800) ["contributors_enabled"]=&gt; bool(false) ["time_zone"]=&gt; string(26) "Pacific Time (US &amp; Canada)" ["name"]=&gt; string(16) "Semirindi Makala" ["listed_count"]=&gt; int(1) ["profile_background_color"]=&gt; string(3) "fff" ["screen_name"]=&gt; string(7) "MASE_85" ["geo_enabled"]=&gt; bool(false) ["protected"]=&gt; bool(false) ["follow_request_sent"]=&gt; bool(false) ["location"]=&gt; string(13) "Teh internets" ["profile_background_image_url"]=&gt; string(69) "http://a0.twimg.com/profile_background_images/422730827/photo__1_.JPG" ["friends_count"]=&gt; int(15) ["verified"]=&gt; bool(false) ["profile_link_color"]=&gt; string(6) "0084B4" ["statuses_count"]=&gt; int(59) ["notifications"]=&gt; bool(false) ["default_profile_image"]=&gt; bool(false) ["favourites_count"]=&gt; int(0) ["lang"]=&gt; string(2) "en" ["profile_background_image_url_https"]=&gt; string(71) "https://si0.twimg.com/profile_background_images/422730827/photo__1_.JPG" ["profile_use_background_image"]=&gt; bool(true) ["profile_image_url_https"]=&gt; string(68) "https://si0.twimg.com/profile_images/1821098433/photo__1__normal.JPG" ["profile_text_color"]=&gt; string(6) "333333" ["followers_count"]=&gt; int(9) ["profile_sidebar_border_color"]=&gt; string(6) "A8C7F7" ["is_translator"]=&gt; bool(false) ["description"]=&gt; string(0) "" ["created_at"]=&gt; string(30) "Sat Jun 20 06:50:28 +0000 2009" } ["in_reply_to_user_id"]=&gt; NULL ["in_reply_to_status_id"]=&gt; NULL ["coordinates"]=&gt; NULL ["geo"]=&gt; NULL ["created_at"]=&gt; string(30) "Sat Dec 08 07:15:50 +0000 2012" ["retweet_count"]=&gt; int(0) ["favorited"]=&gt; bool(false) ["created_at"]=&gt; string(30) "Sat Dec 08 06:40:59 +0000 2012" ["truncated"]=&gt; bool(false) ["in_reply_to_screen_name"]=&gt; NULL ["retweeted"]=&gt; bool(false) ["text"]=&gt; string(29) "Sat, 08 Dec 12 06:40:59 +0000" ["place"]=&gt; NULL ["source"]=&gt; string(65) "&lt;a href="http://www.europe-zone.com" rel="nofollow"&gt;Madscore1&lt;/a&gt;" ["in_reply_to_status_id_str"]=&gt; NULL ["id_str"]=&gt; string(18) "277301732894179328" ["in_reply_to_user_id"]=&gt; NULL ["in_reply_to_status_id"]=&gt; NULL ["id"]=&gt; float(2.7730173289418E+17) } [7]=&gt; object(stdClass)#21 (19) { ["in_reply_to_status_id_str"]=&gt; NULL ["user"]=&gt; object(stdClass)#22 (37) { ["id"]=&gt; int(48948037) ["followers_count"]=&gt; int(9) ["following"]=&gt; bool(false) ["url"]=&gt; NULL ["profile_sidebar_border_color"]=&gt; string(6) "A8C7F7" ["profile_image_url_https"]=&gt; string(68) "https://si0.twimg.com/profile_images/1821098433/photo__1__normal.JPG" ["utc_offset"]=&gt; int(-28800) ["default_profile"]=&gt; bool(false) ["profile_background_tile"]=&gt; bool(true) ["name"]=&gt; string(16) "Semirindi Makala" ["id_str"]=&gt; string(8) "48948037" ["profile_sidebar_fill_color"]=&gt; string(6) "CCD7DB" ["screen_name"]=&gt; string(7) "MASE_85" ["protected"]=&gt; bool(false) ["profile_image_url"]=&gt; string(66) "http://a0.twimg.com/profile_images/1821098433/photo__1__normal.JPG" ["location"]=&gt; string(13) "Teh internets" ["contributors_enabled"]=&gt; bool(false) ["listed_count"]=&gt; int(1) ["time_zone"]=&gt; string(26) "Pacific Time (US &amp; Canada)" ["profile_background_color"]=&gt; string(3) "fff" ["geo_enabled"]=&gt; bool(false) ["notifications"]=&gt; bool(false) ["follow_request_sent"]=&gt; bool(false) ["lang"]=&gt; string(2) "en" ["profile_background_image_url"]=&gt; string(69) "http://a0.twimg.com/profile_background_images/422730827/photo__1_.JPG" ["friends_count"]=&gt; int(15) ["statuses_count"]=&gt; int(56) ["verified"]=&gt; bool(false) ["profile_link_color"]=&gt; string(6) "0084B4" ["default_profile_image"]=&gt; bool(false) ["favourites_count"]=&gt; int(0) ["profile_background_image_url_https"]=&gt; string(71) "https://si0.twimg.com/profile_background_images/422730827/photo__1_.JPG" ["profile_use_background_image"]=&gt; bool(true) ["is_translator"]=&gt; bool(false) ["description"]=&gt; string(0) "" ["profile_text_color"]=&gt; string(6) "333333" ["created_at"]=&gt; string(30) "Sat Jun 20 06:50:28 +0000 2009" } ["contributors"]=&gt; NULL ["coordinates"]=&gt; NULL ["geo"]=&gt; NULL ["retweet_count"]=&gt; int(0) ["favorited"]=&gt; bool(false) ["created_at"]=&gt; string(30) "Sat Dec 08 06:28:19 +0000 2012" ["in_reply_to_user_id_str"]=&gt; NULL ["truncated"]=&gt; bool(false) ["in_reply_to_screen_name"]=&gt; NULL ["retweeted"]=&gt; bool(false) ["text"]=&gt; string(29) "Sat, 08 Dec 12 06:28:18 +0000" ["place"]=&gt; NULL ["source"]=&gt; string(65) "&lt;a href="http://www.europe-zone.com" rel="nofollow"&gt;Madscore1&lt;/a&gt;" ["id_str"]=&gt; string(18) "277298543398617088" ["in_reply_to_user_id"]=&gt; NULL ["in_reply_to_status_id"]=&gt; NULL ["id"]=&gt; float(2.7729854339862E+17) } [8]=&gt; object(stdClass)#23 (19) { ["user"]=&gt; object(stdClass)#24 (37) { ["id"]=&gt; int(48948037) ["default_profile_image"]=&gt; bool(false) ["followers_count"]=&gt; int(9) ["following"]=&gt; bool(false) ["url"]=&gt; NULL ["favourites_count"]=&gt; int(0) ["profile_background_image_url_https"]=&gt; string(71) "https://si0.twimg.com/profile_background_images/422730827/photo__1_.JPG" ["profile_sidebar_border_color"]=&gt; string(6) "A8C7F7" ["utc_offset"]=&gt; int(-28800) ["profile_background_tile"]=&gt; bool(true) ["name"]=&gt; string(16) "Semirindi Makala" ["id_str"]=&gt; string(8) "48948037" ["is_translator"]=&gt; bool(false) ["profile_sidebar_fill_color"]=&gt; string(6) "CCD7DB" ["screen_name"]=&gt; string(7) "MASE_85" ["protected"]=&gt; bool(false) ["profile_image_url"]=&gt; string(66) "http://a0.twimg.com/profile_images/1821098433/photo__1__normal.JPG" ["location"]=&gt; string(13) "Teh internets" ["contributors_enabled"]=&gt; bool(false) ["default_profile"]=&gt; bool(false) ["time_zone"]=&gt; string(26) "Pacific Time (US &amp; Canada)" ["profile_image_url_https"]=&gt; string(68) "https://si0.twimg.com/profile_images/1821098433/photo__1__normal.JPG" ["profile_background_color"]=&gt; string(3) "fff" ["geo_enabled"]=&gt; bool(false) ["notifications"]=&gt; bool(false) ["follow_request_sent"]=&gt; bool(false) ["listed_count"]=&gt; int(1) ["lang"]=&gt; string(2) "en" ["profile_background_image_url"]=&gt; string(69) "http://a0.twimg.com/profile_background_images/422730827/photo__1_.JPG" ["verified"]=&gt; bool(false) ["profile_link_color"]=&gt; string(6) "0084B4" ["profile_use_background_image"]=&gt; bool(true) ["friends_count"]=&gt; int(15) ["description"]=&gt; string(0) "" ["statuses_count"]=&gt; int(51) ["profile_text_color"]=&gt; string(6) "333333" ["created_at"]=&gt; string(30) "Sat Jun 20 06:50:28 +0000 2009" } ["contributors"]=&gt; NULL ["coordinates"]=&gt; NULL ["geo"]=&gt; NULL ["retweet_count"]=&gt; int(0) ["favorited"]=&gt; bool(false) ["created_at"]=&gt; string(30) "Sat Dec 08 06:27:07 +0000 2012" ["truncated"]=&gt; bool(false) ["in_reply_to_screen_name"]=&gt; NULL ["in_reply_to_status_id_str"]=&gt; NULL ["in_reply_to_user_id_str"]=&gt; NULL ["retweeted"]=&gt; bool(false) ["text"]=&gt; string(29) "Sat, 08 Dec 12 06:27:07 +0000" ["place"]=&gt; NULL ["source"]=&gt; string(65) "&lt;a href="http://www.europe-zone.com" rel="nofollow"&gt;Madscore1&lt;/a&gt;" ["id_str"]=&gt; string(18) "277298243392643072" ["in_reply_to_user_id"]=&gt; NULL ["in_reply_to_status_id"]=&gt; NULL ["id"]=&gt; float(2.7729824339264E+17) } [9]=&gt; object(stdClass)#25 (19) { ["user"]=&gt; object(stdClass)#26 (37) { ["id"]=&gt; int(48948037) ["followers_count"]=&gt; int(9) ["profile_image_url_https"]=&gt; string(68) "https://si0.twimg.com/profile_images/1821098433/photo__1__normal.JPG" ["following"]=&gt; bool(false) ["url"]=&gt; NULL ["profile_sidebar_border_color"]=&gt; string(6) "A8C7F7" ["utc_offset"]=&gt; int(-28800) ["default_profile"]=&gt; bool(false) ["profile_background_tile"]=&gt; bool(true) ["name"]=&gt; string(16) "Semirindi Makala" ["id_str"]=&gt; string(8) "48948037" ["profile_sidebar_fill_color"]=&gt; string(6) "CCD7DB" ["screen_name"]=&gt; string(7) "MASE_85" ["protected"]=&gt; bool(false) ["profile_image_url"]=&gt; string(66) "http://a0.twimg.com/profile_images/1821098433/photo__1__normal.JPG" ["location"]=&gt; string(13) "Teh internets" ["contributors_enabled"]=&gt; bool(false) ["listed_count"]=&gt; int(1) ["time_zone"]=&gt; string(26) "Pacific Time (US &amp; Canada)" ["is_translator"]=&gt; bool(false) ["profile_background_color"]=&gt; string(3) "fff" ["geo_enabled"]=&gt; bool(false) ["notifications"]=&gt; bool(false) ["follow_request_sent"]=&gt; bool(false) ["lang"]=&gt; string(2) "en" ["profile_background_image_url"]=&gt; string(69) "http://a0.twimg.com/profile_background_images/422730827/photo__1_.JPG" ["friends_count"]=&gt; int(15) ["statuses_count"]=&gt; int(50) ["verified"]=&gt; bool(false) ["profile_link_color"]=&gt; string(6) "0084B4" ["default_profile_image"]=&gt; bool(false) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload