例子1
$proxy = "118.69.202.160";
$proxyport = "3128";
$ch = curl_init("https://www.111cn.net/");
curl_setopt($ch, curlOPT_RETURNTRANSFER,1);
curl_setopt($ch,curlOPT_proxy,$proxy);
curl_setopt($ch,curlOPT_proxyPORT,$proxyport);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec($ch);
echo $result;
curl_close($ch);
上面的代码如果不好用 请用下面的代码
例子2
function curl_string ($url,$user_agent,$proxy){
$ch = curl_init();
curl_setopt ($ch, CURLOPT_PROXY, $proxy);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_COOKIEJAR, "c:cookie.txt");
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec ($ch);
curl_close($ch);
return $result;
}
$url_page = "https://www.111cn.net";
$user_agent = "Mozilla/4.0";
$proxy = "http://192.***11.222.124:8000";
$string = curl_string($url_page,$user_agent,$proxy);
echo $string;
例子3
$proxy = "80.25.198.25";
$proxyport = "8080";
$ch = curl_init("http://sfbay.c*ra*igsli*st.org/");
curl_setopt($ch, curlOPT_RETURNTRANSFER,1);
curl_setopt($ch,curlOPT_proxy,$proxy);
curl_setopt($ch,curlOPT_proxyPORT,$proxyport);
curl_setopt ($ch, CURLOPT_TIMEOUT, 120);
$result = curl_exec($ch);
echo $result;
curl_close($ch);
恋爱进行时九游版
恋爱进行时九游版是一款以模拟恋爱玩法为核心的角色扮演手游,精
皇室对决fr(Null’s Royale)
皇室对决fr,即皇室战争的私服变态版本,在该版本中玩家能够拥
养了个猫联机版游戏
养了个猫小游戏一个猫咪主题的模拟经营类型的手游,在游戏中我那
模拟山羊收获日小米版
模拟山羊收获日小米版是一个极其魔性的手机游戏,在游戏中玩家将
女配逆袭之素衣
女配逆袭之素衣是一款恋爱养成冒险的一款游戏,可以角色扮演,在