title: How to output JSON results as an integer
body: <p>The problem I've been having is i'm using a twitter end-point to capture certain keywords in tweets but I'm not getting any numerical value in the results to say how many results there are.  Below is the code used:</p>
  
  <pre><code>&lt;?php
  
  $response = file_get_contents('http://search.twitter.com/search.json?q=ps4&amp;rpp=100&amp;geocode=43.652527,-79.381961,10mi&amp;geocode=49.263588,-123.138565,10mi&amp;include_entities=true&amp;result_type=mixed');
  $search = json_decode($response);
  $items = array();
  
  foreach ($search-&gt;results as $item) {
        $items[] = array('text' =&gt; '@'.$item-&gt;from_user.': '.$item-&gt;text);
   }
   $data = array('item' =&gt; $items);
  
   header('Content-Type: application/json');
  
   echo json_encode($data);
  
   ?&gt;
  </code></pre>
  
  <p>The output that I'm getting is just showing user name and tweet. </p>
  
  <pre><code> {"item":[{"text":"@detikcom: Gocekan PES 2014 Bakal Semakin Lincah di PS4 http:\/\/t.co\/CtrUtOf0GI via @detikinet"}}]}
  </code></pre>
  
  <p>What I want is a total number of mentions in a single integer to display.  I can't find anything that would put my on the right path, if someone could point me in the right direction that would be great.</p>
  
  <p>Thanks for reading.</p>