PHP Classes

File: usage.php

Recommend this page to a friend!
  Classes of Hasin Hayder   Extended Array Object   usage.php   Download  
File: usage.php
Role: Example script
Content type: text/plain
Description: Sample Usage
Class: Extended Array Object
Create and manipulate arrays as objects
Author: By
Last change:
Date: 17 years ago
Size: 560 bytes
 

Contents

Class file image Download
<?
include_once("ExtendArrayObject.class.php");

function
speak($value)
{
  echo
$value;

}

$newArray = new ExtendedArrayObject(array(1,2,3,4,5,6));

/* or you can use this */

$newArray = new ExtendedArrayObject(1,2,3,4,5,6);

$newArray->each(speak)
print_r($newArray->without(2,3,4));
$newArray->inspect();
echo
$newArray->indexOf(5);
print_r($newArray->reverse());
print_r($newArray->reverse(true)); /*for changing array itself*/

echo $newArray->shift();
echo
$newArray->pop();
echo
$newArray->last();
echo
$newArray->first();
?>