入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

PHP抓取页面生成HTMl文件简单代码

创建时间:2016-06-14 投稿人: 浏览次数:1750
缓存技术
<?php
	ob_start();//开启缓存
   // $content=  ob_get_contents();//从缓存中获取内容
	$content=file_get_contents("http://localhost/weizhuan/detail.php?aid=349&uid=1534");
    ob_end_clean();//关闭缓存并清空
    /***缓存结束***/
    file_put_contents("ceshi2.html", $content);
    echo $content; 
	echo "ok";
?>



<?php
ob_start();//开启缓存
   // $content=  ob_get_contents();//从缓存中获取内容
$content=file_get_contents("http://localhost/weizhuan/detail.php?aid=349&uid=1534");
    ob_end_clean();//关闭缓存并清空
    /***缓存结束***/
    file_put_contents("ceshi2.html", $content);
    echo $content; 
echo "ok";
?>

声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。