发布打印由twitter API json数据组成的关联数组

When i try to print the associative array it gives me an error in the log file PHP Warning: Invalid argument supplied for foreach() in /var/www/html/twitter.php on line 28

<?php
require_once('TwitterAPIExchange.php');
/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
$settings = array(
'oauth_access_token' => "********",
'oauth_access_token_secret' => "********",
'consumer_key' => "**********",
'consumer_secret' => "************"
);
$url = 'https://api.twitter.com/1.1/search/tweets.json';
$requestMethod = 'GET';
$getfield = '?q=#naran';
$twitter = new TwitterAPIExchange($settings);
$string = json_decode($twitter->setGetfield($getfield)
            ->buildOauth($url, $requestMethod)
            ->performRequest(),true);

//if($string["errors"][0]["message"] != "") {echo "<h3>Sorry, there was a problem.</h3><p>Twitter returned the following error message:</p><p><em>".$string[errors][0]["message"]."</em></p>";exit();}

foreach($string as $items)
{
   echo "Time and Date of Tweet: ".$items['created_at']."<br />";
  echo "Tweet: ". $items['text']."<br />";



}
?>