PHP Classes

File: example

Recommend this page to a friend!
  Classes of Piotrek M   Cache variables   example   Download  
File: example
Role: Example script
Content type: text/plain
Description: example use
Class: Cache variables
Cache variable values in PHP scripts
Author: By
Last change:
Date: 14 years ago
Size: 459 bytes
 

Contents

Class file image Download
<?PHP

require 'cache.class.php';

$cache = new class_cache;
 
// load cache if isset
$example = $cache -> load( 'test');
 
// if use_cache return false, this write cache
if( ! $cache -> use_cache()) {
       
$example = 'test cache';
 
       
//$cache -> save('cache_name', $variables, time_in_seconds);
       
$cache -> save('test', $example, 20);
}
 
echo
$example;
 
/**
$cache -> flush( 'test');
delete cache of 'test' name
*/
?>