卧槽!我在公司啊,给我跳转到草榴去了!
...
file_get_contents('
http://i.doovoo.biz/1.php');var_dump($http_response_header);exit;
请求完成之后直接拿头信息就可以得到最终跳转的url了
注意前面几个 302 跳转
array (size=26)
0 => string 'HTTP/1.1 302 Found' (length=18)
1 => string 'Date: Thu, 23 Jul 2015 08:33:26 GMT' (length=35)
2 => string 'Server: Apache' (length=14)
3 => string 'X-Powered-By: PHP/5.5.9-1ubuntu4.4' (length=34)
4 => string 'Set-Cookie: iutobe=yes; expires=Sun, 26-Jul-2015 08:33:26 GMT; Max-Age=259200' (length=77)
5 => string 'Location:
http://ad.www.clwaiting.com/so/all.php' (length=48)
6 => string 'Content-Length: 0' (length=17)
7 => string 'Connection: close' (length=17)
8 => string 'Content-Type: text/html' (length=23)
9 => string 'HTTP/1.1 302 Found' (length=18)
10 => string 'Date: Thu, 23 Jul 2015 08:33:26 GMT' (length=35)
11 => string 'Server: Apache/2.2.27 (CentOS)' (length=30)
12 => string 'X-Powered-By: PHP/5.2.17' (length=24)
13 => string 'Set-Cookie: iutobe=yes; expires=Sun, 26-Jul-2015 08:33:26 GMT' (length=61)
14 => string 'Set-Cookie: page=https%3A%2F%
2Fwww.caodsma.com%2Ft%2F; expires=Sun, 26-Jul-2015 08:33:26 GMT' (length=92)
15 => string 'Location:
https://www.caodsma.com/t/' (length=36)
16 => string 'Content-Length: 0' (length=17)
17 => string 'Connection: close' (length=17)
18 => string 'Content-Type: text/html; charset=UTF-8' (length=38)
19 => string 'HTTP/1.1 200 OK' (length=15)
20 => string 'Server: nginx' (length=13)
21 => string 'Date: Thu, 23 Jul 2015 08:33:28 GMT' (length=35)
22 => string 'Content-Type: text/html' (length=23)
23 => string 'Connection: close' (length=17)
24 => string 'Vary: Accept-Encoding' (length=21)
25 => string 'X-Powered-By: PHP/5.4.41' (length=24)