有个需求是获取某个html页面的源码。界面很好获取可不我想要的
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://www.qq.com');
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
$data=curl_exec($curl);
echo htmlentities($data);//空的
echo $data; //显示html界面,这不是我想的
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://www.qq.com');
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
$data=curl_exec($curl);
echo htmlentities($data);//空的
echo $data; //显示html界面,这不是我想的