I am using a PHP library (Abraham's OAUTH) as an app to connect to my twitter account and I am pulling down my own tweets from Twitter's API in an attempt to aesthetically display them on my on page.
I'm looping through them all with a foreach
<?php
foreach ($statuses as $key => $status) {
echo '
<blockquote class="twitter-tweet" data-lang="en"><p lang="und" dir="ltr">' . $status->text . '</p>
' . $status->name . ' (@' . $status->screen_name . ') <a href="https://twitter.com/' . $status->screen_name . '/status/' . $status->id_str . '">' . $status->created_at . '</a></blockquote><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script><br>
';
}
?>
These are the from the var_dump and are the ones I am using
array(1) { [0]=> object(stdClass)#3 (25) { ["created_at"]=> string(30) "Fri May 18 10:41:07 +0000 2018" ["id"]=> int(997426852204634112) ["id_str"]=> string(18) "997426852204634112" ["text"]=> string(27) "lol" ["name"]=> string(6) "Example" ["screen_name"]=> string(10) "Example_Name"
However I get returned:
Notice: Undefined property: stdClass::$name
Notice: Undefined property: stdClass::$screen_name
Why is this? I see name and screen_name in the var_dump so why is it not able to pick them up?