In PHP to get HTTP header information, PHP has a function get_headers (), I used to use this, I heard that efficiency in win, plus the recent research Baidu URL no fruit, wrote curl get redirect URL php code to toss.
I used to use get_headers to get the URL after the jump.
Now use curl to rewrite the code again.
Curl is required to set curl_setopt and Curl_getinfo to get location: redirect
Because it is also related to the speed of the two code efficiency I have not tested. I use get_headers local test is possible, but upload to server execution error, do not know why?
php gets the redirect URL in several ways: http://blog.sina.com.cn/s/blog_5b1acf750102v6iw.html
Get location using curl: Redirect URL