I have the following code that prints out the first value in the array (Twitter post):
$connection = new TwitterOAuth($twitter_customer_key, $twitter_customer_secret, $twitter_access_token, $twitter_access_token_secret);
$my_tweets = $connection->get('statuses/user_timeline', array('screen_name' => 'xxx', 'count' => 10));
echo '<div class="tweets">';
if(isset($my_tweets->errors))
{
echo 'Error :'. $my_tweets->errors[0]->code. ' - '. $my_tweets->errors[0]->message;
}else{
echo makeClickableLinks($my_tweets[0] ->text);
}
echo '</div>';
However, I want to print out all values in the array. I have tried using below method as stated here: http://php.net/manual/en/function.array-values.php
array_values($my_tweets)
But that returns the following: "Trying to get property of non-object"
What exactly am I doing wrong?
Thank you.