$nowtime=time();
$pastsec = $nowtime - $_GET["t"];
if($pastsec<60)
{
exit; //1分钟更新一次,时间可以自己调整
}
$content = file_get_contents('https://google-developers.appspot.com/maps/documentation/javascript/examples/full/map-simple?hl=zh-tw');//也可引用扩展名为PHP的网页
$content=preg_replace("/[\r\n]+/", '', $content ); //是将回车去掉,此段可有可无,如影响使用请去除
$content .= "";
file_put_contents("index.html",$content);
if (!function_exists("file_put_contents"))
{
function file_put_contents($fn,$fs)
{
$fp=fopen($fn,"w+");
fputs($fp,$fs);
fclose($fp);
}
}
2013年10月17日 星期四
php generate html
php生成HTML的两种方法、PHP生成静态页的两种方法
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。