我已经尝试过关于如何回显following
的一切,但它一直给我一个错误或它返回空白。例如echo $s->following
会出现错误Notice: Undefined property: stdClass::$following
。我希望对象数组中的第一个跟随输出。代码对象如下:
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 } } }
答案 0 :(得分:1)
我认为因为"跟随"在里面"来源"和"来源"在里面"关系"。因此,您可以尝试使用它来查看它是否有效:$s->relationship->source->following