Location: PHPKode > scripts > tgcSPL > tgcspl/include/RecursiveArrayIterator.php
<?php
/**
 * Recursive array iterator
 *
 * Allows recursive iteration over an array.
 *
 * $Id: RecursiveArrayIterator.php,v 1.1 2004/09/24 01:25:49 luckec Exp $
 *
 * @package     tgcSPL
 * @subpackage  Iterators
 * @author      Carsten Lucke <hide@address.com>
 * @copyright   Carsten Lucke <hide@address.com>
 */
 
/**
 * Recursive array iterator
 *
 * Allows recursive iteration over an array.
 *
 * $Id: RecursiveArrayIterator.php,v 1.1 2004/09/24 01:25:49 luckec Exp $
 *
 * @package     tgcSPL
 * @subpackage  Iterators
 * @access      public
 * @version     1.0.0
 * @author      Carsten Lucke <hide@address.com>
 */
class tgcSPL_RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator
{
    public function hasChildren()
    {
        return is_array($this->current());
    }
    
    public function getChildren()
    {
        return new tgcSPL_RecursiveArrayIterator($this->current());
    }
}
?>
Return current item: tgcSPL