ob缓存页面

来源:互联网 发布:微店系统源码 编辑:程序博客网 时间:2024/04/29 12:54
开启缓存,必须在页面上面
ob_start(),
//获取内容
$str=ob_get_contents();
$filename='ob.html';
//写入文件
file_put_contents($filename,$str);
上面判断是否读取数据即判断页面是否存在
file_exits()判断文件是否存在
file_get_contentd()获得其文件
修改使用到了
把字符串 "Hello world!" 中的字符 "world" 替换为 "Shanghai":
<?phpecho str_replace("world","Shanghai","Hello world!");?>
php引擎是zend Engine。

0 0
原创粉丝点击