title: Getting Guzzle Twitter response data
body: <p>Hopefully the solution to this is a lot more simple than what I've been trying!</p>
  
  <p>I've got a Symfony 2.3 app where I'm attempting to get the number of followers of a Twitter users account. I get back data but I can't access it by array key/index values.</p>
  
  <p>Controller Action:</p>
  
  <pre><code>public function twitterAction(){
      $twitterClient = $this-&gt;container-&gt;get('guzzle.twitter.client');
      $response = $twitterClient-&gt;get('1.1/followers/ids.json?screen_name=ACCOUNTNAME')
              -&gt;send()-&gt;json();
  
      return $this-&gt;render('CatablogSiteBundle:Default:status.html.php', array('response' =&gt; $response));
  
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;?php
  var_dump($response);
  echo '&lt;br&gt;&lt;br&gt;';
  echo gettype($response);
  echo '&lt;br&gt;&lt;br&gt;';
  echo $response[0];
  ?&gt;
  </code></pre>
  
  <p>I get back data that I want to use from var_dump, gettype responds with type <strong>Array</strong> , and attempting to reference $response[0] will fail completely.</p>
  
  <p>What can I do to access data inside the response Object?</p>
  
  <p><strong>edit:</strong></p>
  
  <p>Of course I can't echo $response[0] ... (wrong type) don't try and code tired guys. Solved whilst going over NHG's answer, which is still helpful for anyone having problems with Guzzle.</p>