title: php get_headers location
body: <p>how to use php get_headers only get location part?</p>
  
  <pre><code>var_dump(get_headers('http://www.google.com',1));
  </code></pre>
  
  <p>This return:</p>
  
  <pre><code>array(12) { [0]=&gt; string(18) "HTTP/1.0 302 Found" ["Location"]=&gt; string(21) "http://www.google.it/" ... }
  </code></pre>
  
  <p>Then I use </p>
  
  <pre><code>echo (get_headers('http://www.google.com',1)["Location"];
  </code></pre>
  
  <p>error: <code>Parse error: syntax error, unexpected '['</code> in this <code>echo</code> line</p>