怎麼通過PHP得到此URL跳轉後的URL

來源:互聯網
上載者:User
如何通過PHP得到此URL跳轉後的URL
http://www.chong4.com.cn/cydb/go.php?7218_29882_22t

他是如何跳轉的~~
如何通過PHP得到此URL跳轉後的URL


------解決方案--------------------
$url = 'http://www.chong4.com.cn/cydb/go.php?7218_29882_22t';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$content = curl_exec($ch);
echo $content;
得到

HTTP/1.1 301 Moved Permanently
Server: nginx/1.0.15
Date: Thu, 17 Jan 2013 06:48:10 GMT
Content-Type: text/html
Connection: keep-alive
X-Powered-By: PHP/5.2.17
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 17 Jan 2013 06:48:10 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Location: http://s.click.taobao.com/t?e=zGU34CA7K%2BPkqB07S4%2FK0CFcRfH0G7DbPkiN9MMH7EkQ%2B3KnWlM5fPrbcF5EKeNJ3Ts8ijJ4%2F77oX8O2iw1qEuhEhgaut73j9hJ3YPtNYm616DyrkK0aE1E31WN8TefmpCriY9EJ5O4JCWiRap3Rj1hfNxI2HSqhk8lK01rAylx5%2F9fHp6i%2FPRGYAGeegVo%2F&spm=2014.12231445.1.0&u=22t7218
Content-Length: 0

HTTP/1.1 302 Moved Temporarily
Server: Tengine
Date: Thu, 17 Jan 2013 06:48:22 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close
Location: http://s.click.taobao.com/t_js?tu=http%3A%2F%2Fs.click.taobao.com%2Ft%3Fe%3DzGU34CA7K%252BPkqB07S4%252FK0CFcRfH0G7DbPkiN9MMH7EkQ%252B3KnWlM5fPrbcF5EKeNJ3Ts8ijJ4%252F77oX8O2iw1qEuhEhgaut73j9hJ3YPtNYm616DyrkK0aE1E31WN8TefmpCriY9EJ5O4JCWiRap3Rj1hfNxI2HSqhk8lK01rAylx5%252F9fHp6i%252FPRGYAGeegVo%252F%26spm%3D2014.12231445.1.0%26u%3D22t7218%26ref%3D%26et%3DjFBB1ttOjF2GRA%253D%253D
Expires: Thu, 17 Jan 2013 06:48:22 GMT
Cache-Control: max-age=0

HTTP/1.1 200 OK
Server: Tengine
Date: Thu, 17 Jan 2013 06:48:22 GMT
Content-Type: text/html; charset=GBK
Content-Length: 2267
Last-Modified: Tue, 15 Jan 2013 01:49:17 GMT
Connection: close
Vary: Accept-Encoding
Expires: Thu, 17 Jan 2013 06:48:22 GMT
Cache-Control: max-age=0
Accept-Ranges: bytes






相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.