title: Load tweets with search term in stead of username
body: <p>Now I load the tweets from twitter by using a username like this: (keys and tokens are filled in my code)</p>
  
  <pre><code>&lt;?php
  session_start();
  require_once("twitteroauth/twitteroauth.php"); // PATH TO TWITTEROUTH LIBRARY
  
  if(isset($_GET['twitteruser']) &amp;&amp; !empty($_GET['twitteruser'])) {
      $twitteruser = $_GET['twitteruser']; // USER
  }
  $notweets = 60; // NUMBER OF TWEETS
  
  // OAUTH SETTINGS APPLICATION (https://dev.twitter.com/apps/)
  $consumerkey = "";
  $consumersecret = "";
  $accesstoken = "";
  $accesstokensecret = "";
  
  function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
    $connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
    return $connection;
  }
  
  $connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
  
  $tweets = $connection-&gt;get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser."&amp;count=".$notweets);
  
  $data =  json_encode($tweets);
  
  ?&gt;
  </code></pre>
  
  <p>As you can see I load the tweets with a username and set the number of tweets. <br>
  Can this easily be changed to load tweets with a search term?</p>
  
  <p>I've search on google but strangely I can't find much.</p>
  
  <p>I've found this in the twitter API but that doesn't seem to work ..</p>
  
  <blockquote>
    <p><a href="https://api.twitter.com/1.1/search/tweets.json?q=%23freebandnames&amp;since_id=24012619984051000&amp;max_id=250126199840518145&amp;result_type=mixed&amp;count=4" rel="nofollow">https://api.twitter.com/1.1/search/tweets.json?q=%23freebandnames&amp;since_id=24012619984051000&amp;max_id=250126199840518145&amp;result_type=mixed&amp;count=4</a> </p>
  </blockquote>
  
  <p>source: <a href="https://dev.twitter.com/docs/api/1.1/get/search/tweets" rel="nofollow">https://dev.twitter.com/docs/api/1.1/get/search/tweets</a><br>
  (I changed the link to that link)</p>
  
  <p>But I get this output with a var_dump:</p>
  
  <blockquote>
    <p>string(319) "{"statuses":[],"search_metadata":{"completed_in":0.004,"max_id":2.50126199841e+17,"max_id_str":"250126199840518145","query":"%23freebandnames","refresh_url":"?since_id=250126199840518145&amp;q=%23freebandnames&amp;result_type=mixed&amp;include_entities=1","count":4,"since_id":2.40126199841e+16,"since_id_str":"24012619984051000"}}".....</p>
  </blockquote>