Reputation: 97
I've tried everything on how to echo out following
but it keeps giving me an error or it returns blank. such as echo $s->following
gives error Notice: Undefined property: stdClass::$following
. I want the first following in the object array only to output. Code Object below:
object(stdClass)#11 (1) { ["relationship"]=> object(stdClass)#12 (2) { ["source"]=> object(stdClass)#13 (16) { ["id"]=> int(49216720948621475) ["id_str"]=> string(18) "56435616498624156" ["screen_name"]=> string(15) "lmfao" ["following"]=> bool(true) ["followed_by"]=> bool(false) ["live_following"]=> bool(false) ["following_received"]=> NULL ["following_requested"]=> NULL ["notifications_enabled"]=> NULL ["can_dm"]=> bool(false) ["blocking"]=> NULL ["blocked_by"]=> NULL ["muting"]=> NULL ["want_retweets"]=> NULL ["all_replies"]=> NULL ["marked_spam"]=> NULL } ["target"]=> object(stdClass)#14 (7) { ["id"]=> int(53486451354989563589) ["id_str"]=> string(18) "6873168431643435468" ["screen_name"]=> string(10) "sunshine" ["following"]=> bool(false) ["followed_by"]=> bool(true) ["following_received"]=> NULL ["following_requested"]=> NULL } } }
Upvotes: 0
Views: 1685
Reputation: 490
I think because "following" is inside "source" and "source" is inside "relationship". So you may try this to see if it works : $s->relationship->source->following
Upvotes: 1