之前可以的<?php
function n_r($url) {
$ch = curl_init();
$timeout = 10;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.hahasport.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
@ $c = curl_exec($ch);
curl_close($ch);
$c = mb_convert_encoding($c, 'GBK', 'UTF-8');
return $c;
}
$a = 'http://www.hahasport.com/vt-0/10/42/vt-104227.html';
$str = n_r($a);
echo $str;
?>
function n_r($url) {
$ch = curl_init();
$timeout = 10;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.hahasport.com/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
@ $c = curl_exec($ch);
curl_close($ch);
$c = mb_convert_encoding($c, 'GBK', 'UTF-8');
return $c;
}
$a = 'http://www.hahasport.com/vt-0/10/42/vt-104227.html';
$str = n_r($a);
echo $str;
?>
http://topic.csdn.net/u/20121031/20/3cdec2e8-8efe-4b08-8ab6-588fc95ec3a1.html