protected static function traverseStructure($iterator)
    {
        $children = '';
        while ($iterator->valid()) {

            if ($iterator->hasChildren()) {
                $current = 'array (' . self::traverseStructure($iterator->getChildren()) . '), ';
            } else {
                $current = "'" . $iterator->current() . "', ";
            }

            $key = $iterator->key();

            if (is_numeric($key)) {
                $children .= $key . " => " . $current;
            } else {
                $children .= "'" . $key . "' => " . $current;
            }

            $iterator->next();
        }

        return $children;
    }
protected static function traverseStructure($iterator)
    {
        $children = '';
        while ($iterator->valid()) {

            if ($iterator->hasChildren()) {
                $current = 'array (' . self::traverseStructure($iterator->getChildren()) . '), ';
            } else {
                $current = "'" . $iterator->current() . "', ";
            }

            $key = $iterator->key();

            if (is_numeric($key)) {
                $children .= $key . " => " . $current;
            } else {
                $children .= "'" . $key . "' => " . $current;
            }

            $iterator->next();
        }

        return $children;
    }
protected static function traverseStructure ( $ iterator ) { $ children = '' ; while ( $ iterator -> valid ( ) ) { if ( $ iterator -> hasChildren ( ) ) { $ current = 'array (' . self :: traverseStructure ( $ iterator -> getChildren ( ) ) . '), ' ; } else { $ current = "'" . $ iterator -> current ( ) . "', " ; } $ key = $ iterator -> key ( ) ; if ( is_numeric ( $ key ) ) { $ children .= $ key . " => " . $ current ; } else { $ children .= "'" . $ key . "' => " . $ current ; } $ iterator -> next ( ) ; } return $ children ; }
Walks recursivly throught an array and concatinates the found info to a string.

@param \RecursiveIterator $iterator

@return string
Walks recursivly throught an array and concatinates the found info to a string .