21,887
社区成员
发帖
与我相关
我的任务
分享
$ch= curl_init("http://www.baidu.com");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_exec($ch);
$aaa = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
echo $aaa;
$url="http://www.baidu.com";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_exec($ch);
$aaa = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
echo $aaa;