以使用PHP中的curl函数或file_get_contents函数打开网页。例如,使用curl函数可以这样做:
$url = \'http://www.example.com\';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
或者,使用file_get_contents函数可以这样做:
$url = \'http://www.example.com\';
$output = file_get_contents($url);
echo $output;