PHP Classes

File: Example.php

Recommend this page to a friend!
  Classes of troy knapp   PHP Array Cache File   Example.php   Download  
File: Example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Array Cache File
Store array values in PHP cache file scripts
Author: By
Last change:
Date: 8 years ago
Size: 489 bytes
 

Contents

Class file image Download
<?php
namespace ArrayCache;
/**
 * Class: $classStr
 * User: troy
 * Date: 5/7/2016
 * Time: 9:24 AM
 */
require_once 'ArrayCache.php';

$array = array(
   
123,
   
'animals' => array(
       
'dog',
       
'cat',
       
'mouse',
       
'bird'
   
),
   
'key' => 'value',
   
'foo' => 'bar'
);
$filename = dirname(__FILE__) . '/cache/example.php';

$ac = new ArrayCache($array, $filename);

$cachedArray = require_once $filename;

var_dump($cachedArray);