标签:effective timeout ati new info time 输出内容 out nsf
<?php
$url = urldecode($_REQUEST[‘url‘]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 200);
curl_setopt($ch, CURLOPT_HEADER, false); //不需要输出头部信息
curl_setopt($ch, CURLOPT_NOBODY, true); //不用输出内容
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); //超时重试
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); //抓取转跳
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, ‘GET‘); //post方式提交
curl_exec($ch);
$newUrl = curl_getinfo($ch,CURLINFO_EFFECTIVE_URL); //获取真实的url
curl_close($ch);
echo $newUrl;exit;
?>
标签:effective timeout ati new info time 输出内容 out nsf
原文地址:http://www.cnblogs.com/gaogaoxingxing/p/7439595.html