title: Sort the tweets by date using Twitter Search API
body: <p>I have written an application that searches tweets for a specific keyword using the twitter API, but i am trying to find a way to display the latest tweets first, i am unable to find a way to sort the tweets received as a response.</p>
  
  <p>I am referring to link <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> and below is my code</p>
  
  <p>I have included all necessary files and set all required parameters</p>
  
  <pre><code>    function search(array $query)
  {
    $toa = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
    return $toa-&gt;get('search/tweets', $query);
  }
  
  $query = array(
    "q" =&gt; "Sachin Tendulkar",
    "count" =&gt; 10,
    "result_type" =&gt; "popular"
   );
  
  $results = search($query);
  </code></pre>
  
  <p>Any help on this would be appreciated. Thanks</p>