title: Reading Twitter JSON data using php for API 1.1
body: <p>I had to make a mad scramble to get all my Twitter feeds going again when API 1.0 was closed. It took a while but I managed to get the GET statuses/user_timeline working again. Now I'm attempting to use the search and I'm not being able to read the results. The JSON file is returning the correct data.</p>
  
  <p>Here is my PHP code:</p>
  
  <pre><code>$code = $tmhOAuth-&gt;request('GET', $tmhOAuth-&gt;url('1.1/search/tweets'), array(
       'q' =&gt; '%23'.$tagzname,
       'since_id' =&gt; $num,
       'lang' =&gt; 'en',
       'count' =&gt; '2'));
  
   $response = $tmhOAuth-&gt;response['response'];
  
   var_dump(json_decode($response, true));
   echo "&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;";
  
   $json_output = json_decode($response, true);
  
   foreach($json_output as $tweets) {
  
     // $tmsgid   = $tweets['statuses']['metadata']['id_str'];
     $tmsgid   = $tweets['statuses']['id_str'];
     // $tmsgid   = $tweets['metadata']['id_str'];
     // $tmsgid   = $tweets['id_str'];
     echo 'Msg ID:' . $tmsgid . '&lt;br&gt;';
  </code></pre>
  
  <p>I just can't get the Msg ID output. What am I missing?</p>
  
  <p>The JSON data looks like this:</p>
  
  <pre><code>array(2) {
    ["statuses"]=&gt;
    array(2) {
      [0]=&gt;
      array(23) {
        ["metadata"]=&gt;
        array(2) {
          ["result_type"]=&gt;
          string(6) "recent"
          ["iso_language_code"]=&gt;
          string(2) "en"
        }
        ["created_at"]=&gt;
        string(30) "Thu Jun 13 07:19:30 +0000 2013"
        ["id"]=&gt;
        float(3.4507795373608E+17)
        ["id_str"]=&gt;
        string(18) "345077953736081409"
        ...
  </code></pre>