<?
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();
?>
|