The header () function in PHP sends a specific cache to control the original HTTP header. the header () must be called before any actual output, whether it is from a common HTML tag or empty
The header () function in PHP sends a specific cache to control the original HTTP header. the header () must be called before any actual output, whether from a common HTML tag, empty line, or PHP, in a Chinese environment, a full-width space will also lead to hard-to-find errors.
- // The following statement sets the expiration time of this page (expressed by Greenwich Mean Time), as long as it is a date that has passed.
- Header ("Expires: Mon, 26 Jul 1970 05:00:00 GMT ");
- // The following statement sets the last update date (expressed by Greenwich Mean Time) on this page to the current day, and forces the browser to obtain the latest information.
- Header ("Last-Modified:". gmdate ("D, d m y h: I: s"). "GMT ");
- // Tell the client browser not to use the cache, HTTP 1.1 Protocol
- Header ("Cache-Control: no-cache, must-revalidate ");
- // Tells the client browser not to use the cache and is compatible with the HTTP 1.0 Protocol
- Header ("Pragma: no-cache ");
- ?>