Документация PHP
| Документация DHTML | Документация Smarty | SVG/VML Графика и JavaScript
| Документация bash |
The ArrayIterator class
Введение
This iterator allows to unset and modify values and keys while iterating over Arrays and Objects.
When you want to iterate over the same array multiple times you need to instanciate ArrayObject and let it create ArrayIterator instances that refer to it either by using foreach or by calling its getIterator() method manually.
Class synopsis
ArrayIterator
class ArrayIterator implements Iterator , Traversable , ArrayAccess , SeekableIterator , Countable {
/* Methods */
mixed current ( void )
mixed key ( void )
void next ( void )
void rewind ( void )
void seek ( int $position )
bool valid ( void )
}Содержание
- ArrayIterator::current — Return current array entry
- ArrayIterator::key — Return current array key
- ArrayIterator::next — Move to next entry
- ArrayIterator::rewind — Rewind array back to the start
- ArrayIterator::seek — Seek to position
- ArrayIterator::valid — Check whether array contains more entries