【发布时间】:2011-10-29 07:54:39
【问题描述】:
如何使用 php get_headers 只获取位置部分?
var_dump(get_headers('http://www.google.com',1));
这个回报:
array(12) { [0]=> string(18) "HTTP/1.0 302 Found" ["Location"]=> string(21) "http://www.google.it/" ... }
然后我用
echo (get_headers('http://www.google.com',1)["Location"];
错误:Parse error: syntax error, unexpected '[' 在此 echo 行中
【问题讨论】:
标签: php get-headers