Home >Backend Development >PHP Tutorial >Getting Started with PHP Page Staticization php7 PHP Environment Setup PHP from Beginner to Master

Getting Started with PHP Page Staticization php7 PHP Environment Setup PHP from Beginner to Master

WBOY
WBOYOriginal
2016-07-29 08:50:311060browse

/**

*PHP page staticization is divided into the following steps:

*1. Open the output control cache

*2. Return the content of the output buffer area

*3. Write a string to the file

*4. Flush Extract the contents of the cache

*/

//1. Turn on the output control cache
ob_start();
?>


php Static page


Static php page


//2. Return to output cache The contents of the area
$contents = ob_get_contents();

//3. Write a string to the file
file_put_contents("newindex.html",$contents);


//4. Flush out the cache area Content
ob_flush();

?>

The above introduces the introduction to static PHP pages, including PHP content. I hope it will be helpful to friends who are interested in PHP tutorials.

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