Login   Register  
PHP Classes
elePHPant
Icontem

File: Test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Bao Nguyen Quoc  >  Magic Array  >  Test.php  >  Download  
File: Test.php
Role: Example script
Content type: text/plain
Description: Test file
Class: Magic Array
Provide enhanced array functionality
Author: By
Last change:
Date: 2008-02-05 03:21
Size: 491 bytes
 

Contents

Class file image Download
<?php

require_once "MagicArray.php";

$array = new MagicArray(); // now you can work with this object as an array

$array[] = 'test';
$array['Test'] = 'hello world';

echo 
"count : " count($array) . "<br/>"// 2

reset($array); // 'test'
next($array); // 1

echo "Current : " current($array) . "<br/>";

echo 
"array[test] : " $array['test'] . "<br/>"// index is case in-sensitive

$array->remove('hello world'); // easier to remove value

print_r($array);

?>