2011年1月16日

摘要: $url = "http://sinaurl.cn/hbdsU5";echo unshorten($url);function unshorten($url) { $url = trim($url); $headers = get_headers($url); $location = $url; $short = false; foreach($headers as $head) { if($head=="HTTP/1.1 302 Found") $short = true; if($short && startwith($head,"Location: ")) { $location = s 阅读全文

posted @ 2011-01-16 12:07 Ruler 阅读(397) 评论(0) 推荐(0)

摘要: $url = "http://sinaurl.cn/hbdsU5";echo unshorten($url);function unshorten($url) { $url = trim($url); $headers = get_headers($url); $location = $url; $short = false; foreach($headers as $head) { if($head=="HTTP/1.1 302 Found") $short = true; if($short && startwith($head,"Location: ")) { $location = s 阅读全文

posted @ 2011-01-16 12:03 Ruler 阅读(97) 评论(0) 推荐(0)


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3