PHP cache Multi-level directory development Example

Source: Internet
Author: User
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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.