In the previous lesson we introduced the use of PHP cache development ideas and examples, see the previous course of the small partners should know that the cache processing for the execution of the program is helpful, the PHP cache class can be used to detect whether the file in the set update time, clear cache files, Generates a cache file name based on the current dynamic file and creates a directory. Cache file output and so on functions ~
So today we will continue to introduce the development of PHP cache, today we are going to introduce the PHP cache multi-level directory instances, the first step we also need to download the PHP cache class we use:
http://www.php.cn/xiazai/leiku/700
Next we extract the downloaded files into our local editor, OK, and then create a new PHP file to invoke the class:
<?phpinclude_once "codehuancun.php"; $cache = new Php_cache (' index '); Cache Level Two Directory $cache = new Php_cache (' Index ', 1800); Cache time Default 1800 $cache = new Php_cache (' index ', 1800,1); Need level Three directory 0: No 1 required Default 0$cache = new Php_cache (' Index ', 1800,1, '. html ');//cache suffix default .html?>
This is to give you as a better explanation, so the code step by step separately speaking, in fact, only need the last line of code on OK!
Finally we run the PHP file, and then the page has no data, but a directory is created on the local server: