search - Twitter API 1.1 Illegal string offset 'statuses' -
im running twitter api v1.1.
$tweets= $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=".$searchstring."&result_type=mixed&rpp=100&count=".$notweets); $twitter=json_encode($tweets); ($i = 0; $i < sizeof($twitter["statuses"]); $i++) { echo $twitter["statuses"][$i]; }
warning: illegal string offset 'statuses'
why wrong offset?
$tweets= $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=".$searchstring."&result_type=mixed&rpp=100&count=".$notweets); $twitter=json_encode($tweets); foreach($tweets->statuses $tweet){ echo $tweet; }
Comments
Post a Comment