Posted on 2007-02-10 23:09
pts 閱讀(5282)
評論(1) 編輯 收藏
簡單的做法:
<?php
$url="http://www.tkk7.com/pts";
echo file_get_contents( $url );
?>
或者:
<?
if ($stream = fopen('http://www.sohu.com', 'r')) {
// print all the page starting at the offset 10
echo stream_get_contents($stream, -1, 10);
fclose($stream);
}
if ($stream = fopen('http://www.sohu.net', 'r')) {
// print the first 5 bytes
echo stream_get_contents($stream, 5);
fclose($stream);
}
?>
但是如果將url換成自己的bolg時,返回的中文顯示為亂碼?
powered by performancing firefox