一:curl
$ch = curl_init();
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_TIMEOUT,$second);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_URL,$url);
。。。
$data = curl_exec($ch);
curl_close($ch);
二:fsockopen
$fp = @fsockopen('www.belie8.com',80,$errno,$errstr,$timeout);
@fputs($fp,"GET /s?wd=... HTTP/1.1
Host:www.belie8.com
Connection:Close
");
while($fp && !feof($fp))
$data .=fread($fp,1024)
@fclose($fp);
三:file_get_contents 采集
$files = @file_get_contents( "http://www.beie8.com/belie8.txt" );
$arr = explode( "
", $files );
$arr = array_reverse($arr);