復制代碼 代碼如下:
<?php
$handle = fopen ("http://s.vevb.com/", "rb");
$contents = "";
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
echo $contents; //輸出獲取到得內容。
?>
復制代碼 代碼如下:
// 對 PHP 5 及更高版本可以使用下面的代碼
<?php
$handle = fopen("http://s.vevb.com", "rb");
$contents = stream_get_contents($handle);
fclose($handle);
echo $contents;
?>
復制代碼 代碼如下:
<?php
$url = "http://s.vevb.com";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT,10);
$dxycontent = curl_exec($ch);
echo $dxycontent;
?>
新聞熱點
疑難解答