Location: PHPKode > scripts > tgcSPL > tgcspl/test/test.php
<?php
error_reporting(E_ALL);
require_once 'tgc/tgcSPL/RecursiveArrayIterator.php';

$a = array(
    'a' => 'foo',
    'b' => 'bar',
    'foobar' => array(1,2,3,4,5)
);

$it = new RecursiveIteratorIterator(
    new tgcSPL_RecursiveArrayIterator($a), RIT_SELF_FIRST
);

foreach ($it as $k => $v) {
    echo "[$k] => $v\n";
}
?>
Return current item: tgcSPL