当get_headers 服务器返回403 forbidden 怎么获得 短网址 真实地址?
------解决方案--------------------
- PHP code
<?php$header = "Host: t.cn\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Encoding: gzip,deflate,sdch\r\nAccept-Language: zh-CN,zh;q=0.8,en;q=0.6,en-US;q=0.4,sq;q=0.2\r\nAccept-Charset: UTF-8,*;q=0.5\r\n";$request = array('method' => 'GET', 'header' => $header );stream_context_get_default( array('http'=>$request) );// 我以新浪微薄为例$response = get_headers("http://t.cn/SfwrDk", 1);var_dump($response['Location']);