迭代器
PHP Manual

The RecursiveArrayIterator class

(PHP 5 >= 5.1.0, PHP 7)

简介

This iterator allows to unset and modify values and keys while iterating over Arrays and Objects in the same way as the ArrayIterator. Additionally it is possible to iterate over the current iterator entry.

类摘要

RecursiveArrayIterator extends ArrayIterator implements RecursiveIterator {
/* 常量 */
const integer CHILD_ARRAYS_ONLY = 4 ;
/* 方法 */
public RecursiveArrayIterator getChildren ( void )
public bool hasChildren ( void )
/* Inherits */
public void ArrayIterator::append ( mixed $value )
public void ArrayIterator::asort ( void )
public ArrayIterator::__construct ([ mixed $array = array() [, int $flags = 0 ]] )
public int ArrayIterator::count ( void )
public mixed ArrayIterator::current ( void )
public array ArrayIterator::getArrayCopy ( void )
public void ArrayIterator::getFlags ( void )
public mixed ArrayIterator::key ( void )
public void ArrayIterator::ksort ( void )
public void ArrayIterator::natcasesort ( void )
public void ArrayIterator::natsort ( void )
public void ArrayIterator::next ( void )
public bool ArrayIterator::offsetExists ( mixed $index )
public mixed ArrayIterator::offsetGet ( mixed $index )
public void ArrayIterator::offsetSet ( mixed $index , mixed $newval )
public void ArrayIterator::offsetUnset ( mixed $index )
public void ArrayIterator::rewind ( void )
public void ArrayIterator::seek ( int $position )
public string ArrayIterator::serialize ( void )
public void ArrayIterator::setFlags ( string $flags )
public void ArrayIterator::uasort ( callable $cmp_function )
public void ArrayIterator::uksort ( callable $cmp_function )
public string ArrayIterator::unserialize ( string $serialized )
public bool ArrayIterator::valid ( void )
}

预定义常量

RecursiveArrayIterator Flags

RecursiveArrayIterator::CHILD_ARRAYS_ONLY

Treat only arrays (not objects) as having children for recursive iteration.

更新日志

版本 说明
5.3.0 CHILD_ARRAYS_ONLY flag was added.

Table of Contents


迭代器
PHP Manual