<BR>$url = "http://sinaurl.cn/hbdsU5"; <BR>echo unshorten($url); <BR>function unshorten($url) { <BR>$url = trim($url); <BR>$headers = get_headers($url); <BR>$location = $url; <BR>$short = false; <BR>foreach($headers as $head) { <BR>if($head=="HTTP/1.1 302 Found") $short = true; <BR>if($short && startwith($head,"Location:<p style="color:transparent">。本文来源gao!%daima.com搞$代*!码网1</p><cite>搞代gaodaima码</cite> ")) { <BR>$location = substr($head,10); <BR>} <BR>} <BR>return $location; <BR>} <BR>function startwith($Haystack, $Needle){ <BR>return strpos($Haystack, $Needle) === 0; <BR>} <BR>