dphs48626 2015-08-21 11:20
浏览 35

PHP Curl检索个人网站的足球结果显示空白页面

Simple PHP code to retrieve information from a site gives me blank page.

$url='http://www.livescore.com/';
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
echo file_get_contents_curl($url);

Can you please tell me where I'm wrong?

  • 写回答

0条回答 默认 最新

    报告相同问题?