$url = 'http://www.example.com';
$content = file_get_contents($url);
$url = 'http://www.example.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$url = 'http://www.example.com';
$handle = fopen($url, 'r');
$content = stream_get_contents($handle);
fclose($handle);
这些方法都可以用来访问URL并获取其内容,选择适合自己需求的方法来完成网页内容的获取。