


Copy the code The code is as follows:
ob_start();#Turn on the server cache
include_once 'Index.php';
$ctx=ob_get_contents();#Get the cache
ob_end_clean();#Clear the cache
$ fh=fopen("index.html","w+");
fwrite($fh,$ctx);# Write html and generate html
fclose($fh);
1. Flush: refresh the buffer content, output.
Function format: flush()
Description: This function is frequently used and is very efficient.
2. ob_start: Open the output buffer
Function format: void ob_start(void)
Description: When the buffer is activated, all non-file header information from the PHP program will not be sent, but will be saved in the internal buffer. In order to output the contents of the buffer, you can use ob_end_flush() or flush() to output the contents of the buffer.
3, ob_get_contents: Return the contents of the internal buffer.
Use
Function format: string ob_get_contents(void)
Description: This function will return the contents of the current buffer. If the output buffer is not activated, it will return FALSE.
4. ob_get_length: Returns the length of the internal buffer.
Usage: int ob_get_length(void)
Description: This function will return the length in the current buffer; like ob_get_contents, if the output buffer is not activated. then returns FALSE.
5. ob_end_flush: Send the contents of the internal buffer to the browser and close the output buffer.
Usage: void ob_end_flush(void)
Description: This function sends the contents of the output buffer (if any).
6. ob_end_clean: Delete the contents of the internal buffer and close the internal buffer.
Usage: void ob_end_clean(void)
Explanation: This function will not output the contents of the internal buffer but delete it!
7. ob_implicit_flush: Turn on or off absolute refresh
Usage method: void ob_implicit_flush ([int flag])
Copy the code The code is as follows:
///////////////////////////////////////////// /////////////////////////////////////
//
// Zhang Shulin-Huijia Studio
/ /
// Module Name: woods-bhtml.php
// Abstract: Generate static HTML handler tail
// Version: 2.0
// Date 1006-11-25
// Author: woods·zhang
// Website: http://www.hoojar.com/
// Email: hoojar@53.com
// MSN: hoojar@hotmail.com
// Copyright 1001-1006, Hoojar studio All Rights Reserved
//
/ / Copyright 1001-1006, all rights reserved by Huijia Studio
//The software for free software, allowing use, copy,
//modify and distribute the software and files. Any
//use of this software must place a copy of all the
//above copyright notice. By the software Huijia studio
//maintenance, if you have any queries please contact us.
//Thank you.
//
//This software is free software and is allowed to be used, Copy, modify, and distribute this software and its documentation.
//All copies of the above copyright notice must appear wherever this software is used. This software is maintained by
//Huijia Studio. If you have any questions, please contact us. Thank you for using it.
//
///////////////////////////////////////////////// ///////////////////////////////////
//This file can only be loaded at the end of the program
/*_______________ _Generate HTML file_______________beign____________________________*/
if ($make_html)
{
$buffer = ob_get_flush();
if ($go_html)//Whether to directly go to the HTML file display or PHP to read the content output (0:php read Content output 1: direct transfer)
{
/*__________ handles the path problems caused by generating HTML files____________________begin_______________*/
$search = array(
"/(src=|action=|href=|ajaxRead ()"/ie",
"/.../e",
"/././e",
"/../http:///ies",
"/../#/" ,
"/'.'/e",
"/../javascript:/ies");
$replace = array(
"'\1"../'",
"'..'",
"'.'",
"'http://'",
"#",
"''..''",
"'javascript:'");
$buffer = preg_replace($search, $replace, $buffer);
/*__________Handle path problems caused by generating HTML files____________________end_______________*/
}
$fp = fopen(HTML_FILE, "w");
if ($fp)
{
fwrite($fp, $buffer);
fclose($fp);
}
}
/*______________Generate HTML file_______________beign____________________________*/
?>
////// ///////////////////////////////////////////////////// ////////////////////////
//
// Zhang Shulin-Huijia Studio
//
// Module Name: woods-thtml.php
// Abstract: Generate static HTML handler header
// Version: 2.0
// Date 1006-11-25
// Author: woods·zhang
// Website: http://www.hoojar.com/
/ / Email: hoojar@53.com
// MSN: hoojar@hotmail.com
// Copyright 1001-1006, Hoojar studio All Rights Reserved
//
// Copyright 1001-1006, Hoojar studio All rights reserved
//The software for free software, allowing use, copy,
//modify and distribute the software and files. Any
//use of this software must place a copy of all the
//above copyright notice. By the software Huijia studio
//maintenance, if you have any queries please contact us.
//Thank you.
//
//This software is free software, and you are allowed to use, copy, modify, and distribute this software and its documentation.
//All copies of the above copyright notice must appear wherever this software is used. This software is maintained by
//Huijia Studio. If you have any questions, please contact us. Thank you for using it.
//
///////////////////////////////////////////////// ///////////////////////////////////
//This file can only be loaded at the beginning of the program
ob_start();
/*___________ Determine whether the HTML file has been generated. If so, jump to the HTML page___________begin__________*/
$qstring = isset($_SERVER["QUERY_STRING"]) ? $_SERVER["QUERY_STRING"] : " ";
if ($qstring)//The program adds GET request processing
{
$qstring = str_replace("=", "", $qstring);
define("HTML_FILE", "./h/{$ efilename}-{$qstring}.html");
}
else
{
define("HTML_FILE", "./h/{$efilename}.html");
}
if (file_exists(HTML_FILE))
{
$lcft = filemtime(HTML_FILE);//last create file time
if (($lcft + 3600) > time())//Determine whether the last HTML file generated was 1 time in the past, and if not, output it directly File content
{
if ($show_html)//Whether to display as HTML static page (0 not to display in HTML 1 to display in html)
{
if ($go_html)//Whether to go directly to HTML file display or PHP Read content output (0: php read content output 1: direct transfer)
{
header("Location: " . HTML_FILE);//direct transfer
}
else
{
echo(file_get_contents(HTML_FILE));// Read out the display
}
exit(0);
}
}
}
/*___________ Determine whether the HTML file has been generated, if so, jump to the HTML page___________end__________*/
?>
////////////////////////////////////////////////// /////////////////////////////////
//
// Zhang Shulin - Huijia Studio
//
// Module Name: index.php
// Abstract: Home page information
// Version: 1.0
// Date 2006-11-7
// Author: woods·zhang
// Website: http://www.hoojar.com /
// Cemail: hoojar@163.com
// MSN: hoojar@hotmail.com
// Copyright 2001-2006, Hoojar studio All Rights Reserved
//
// Copyright 2001-2006, Hoojar studio All Rights Reserved Copyright protection
//The software for free software, allowing use, copy,
//modify and distribute the software and files. Any
//use of this software must place a copy of all the
//above copyright notice. By the software Huijia studio
//maintenance, if you have any queries please contact us.
//Thank you.
//
//This software is free software, and you are allowed to use, copy, modify, and distribute this software and its documentation.
//All copies of the above copyright notice must appear wherever this software is used. This software is maintained by
//Huijia Studio. If you have any questions, please contact us. Thank you for using it.
//
///////////////////////////////////////////////// ///////////////////////////////////
require("woods-thtml.php");//Generate HTML processing Header
//if (count($_GET) require("{$exec_file }");//Register language definition file
foreach ($lang as $key => $value)
{
$atpl[strtoupper($key) ."_LANG"] = $value;
}
/*____________________________ _List common sense items going up __________________end_______________*/
include("woods-templates.php");
$tpl = new WoodsTpl("./templates/");
$tpl->require_tpl("header.html ");
$tpl->set_file();
$tpl->block("EBCORP", $scorp);
$tpl->block("NEWS", $news);
$tpl-> ;block("PRODUCT", $product);
$tpl->block("EBPNAME_MSG", $spname);
$tpl->block("LORE", $lore);
$tpl->require_tpl ("footer.html");
$tpl->parse($atpl, true);
$tpl = NULL;
/*______________template operation_______________________________end_______________________________*/
require("woods-bhtml.php") ;//Generate HTML processing tail
?>
The above introduces which browser is the fastest and how to use PHP to generate static HTML, including the content of which browser is the fastest. I hope it will be helpful to friends who are interested in PHP tutorials.

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

PHP logging is essential for monitoring and debugging web applications, as well as capturing critical events, errors, and runtime behavior. It provides valuable insights into system performance, helps identify issues, and supports faster troubleshoot

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

The article discusses adding custom functionality to frameworks, focusing on understanding architecture, identifying extension points, and best practices for integration and debugging.

Alipay PHP...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment