|
The ArrayIterator classIntroductionAllows the removal of elements, and the modification of keys or values while iterating over arrays or objects. To iterate the same array more than once, it is recommended to instantiate ArrayObject and use the ArrayIterator instance either implicitly created when using foreach to iterate over the array stored internally, or create one by calling the ArrayObject::getIterator method manually. Class synopsis
ArrayIterator
implements
SeekableIterator
ArrayAccess
Serializable
Countable
/* Constants */
public
const
int
ArrayIterator::STD_PROP_LIST;
public
const
int
ArrayIterator::ARRAY_AS_PROPS;
/* Methods */
public __construct(arrayobject
$array = [], int $flags = 0)public void append(mixed
$value )public true asort(int
$flags = SORT_REGULAR )public int count()
public mixed current()
public array getArrayCopy()
public int getFlags()
public stringintnull key()
public true ksort(int
$flags = SORT_REGULAR )public true natcasesort()
public true natsort()
public void next()
public bool offsetExists(mixed
$key )public mixed offsetGet(mixed
$key )public void offsetSet(mixed
$key , mixed $value )public void offsetUnset(mixed
$key )public void rewind()
public void seek(int
$offset )public string serialize()
public void setFlags(int
$flags )public true uasort(callable
$callback )public true uksort(callable
$callback )public void unserialize(string
$data )public bool valid()
Predefined ConstantsArrayIterator Flags
|