title: Retrieve Twitter's X-RateLimit-Limit in PHP
body: <p>With every Twitter request I make, <a href="https://dev.twitter.com/docs/rate-limiting/faq" rel="nofollow">the returned HTTP headers should include X-RateLimit-Limit</a>.</p>
  
  <p>However, I seem unable to retrieve these using PHP.  Can someone tell me what bone-headed mistake I've made?</p>
  
  <p>I've set my curl up in the normal way and am able to successfully GET and POST requests.</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_HEADER, FALSE);
  curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
  curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
  
  $response = curl_exec($ch);
  $response_info=curl_getinfo($ch);
  $erno = curl_errno($ch);
  $er = curl_error($ch);
  curl_close($ch);
  </code></pre>
  
  <p>I'm able to get some response information, like http_code</p>
  
  <pre><code>$response_info['http_code']
  </code></pre>
  
  <p>But this line just returns null</p>
  
  <pre><code>//Doesn't bloody work. No idea why!
  $rate_limit = $response_info['X-RateLimit-Limit'];
  </code></pre>
  
  <p>I'm running PHP Version 5.3.10.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is the result of print_r($response_info);</p>
  
  <pre><code>Array
  (
  [url] =&gt; https://api.twitter.com/1/statuses/home_timeline.json...
  [content_type] =&gt; application/json;charset=utf-8
  [http_code] =&gt; 200
  [header_size] =&gt; 695
  [request_size] =&gt; 410
  [filetime] =&gt; -1
  [ssl_verify_result] =&gt; 0
  [redirect_count] =&gt; 0
  [total_time] =&gt; 1.239977
  [namelookup_time] =&gt; 0.007361
  [connect_time] =&gt; 0.155783
  [pretransfer_time] =&gt; 0.465397
  [size_upload] =&gt; 0
  [size_download] =&gt; 99425
  [speed_download] =&gt; 80182
  [speed_upload] =&gt; 0
  [download_content_length] =&gt; 99425
  [upload_content_length] =&gt; 0
  [starttransfer_time] =&gt; 0.794829
  [redirect_time] =&gt; 0
  [certinfo] =&gt; Array()
  [redirect_url] =&gt; 
  [request_header] =&gt; GET /1/statuses/home_timeline.json... HTTP/1.1
  Host: api.twitter.com
  Accept: */*
  )
  </code></pre>