Home > php教程 > php手册 > body text

PHP页面静态化入门 - unique196

WBOY
Release: 2016-05-20 10:14:34
Original
902 people have browsed it

/**

 *PHP页面静态化分为以下步骤:

 *1.打开输出控制缓存

 *2.返回输出缓存区的内容

 *3.将一个字符串写入文件

 *4.冲刷出缓存区的内容

 */

//1.打开输出控制缓存
ob_start();
?>


php页面静态化


php页面静态化


//2.返回输出缓存区的内容
$contents = ob_get_contents();

//3.将一个字符串写入文件
file_put_contents("newindex.html",$contents);


//4.冲刷出缓存区的内容
ob_flush();

?>

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!