Home  >  Article  >  php教程  >  PHP页面静态化入门 - unique196

PHP页面静态化入门 - unique196

WBOY
WBOYOriginal
2016-05-20 10:14:34944browse

/**

 *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();

?>

Statement:
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