PHP Classes

File: example

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  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: 5 years ago
Size: 459 bytes


Class file image Download

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);
$cache -> flush( 'test');
delete cache of 'test' name