|
SPL-StandardPHPLibrary
|


Public Member Functions | |
| __construct ($array, $flags=0) | |
| append ($value) | |
| asort () | |
| count () | |
| current () | |
| getArrayCopy () | |
| getFlags () | |
| key () | |
| ksort () | |
| natcasesort () | |
| natsort () | |
| next () | |
| offsetExists ($index) | |
| offsetGet ($index) | |
| offsetSet ($index, $newval) | |
| offsetUnset ($index) | |
| rewind () | |
| seek ($position) | |
| setFlags ($flags) | |
| uasort (mixed cmp_function) | |
| uksort (mixed cmp_function) | |
| valid () | |
Public Attributes | |
| const | ARRAY_AS_PROPS = 0x00000002 |
| const | STD_PROP_LIST = 0x00000001 |
An Array iterator.
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.
| ArrayIterator::__construct | ( | $array, | |
$flags = 0 |
|||
| ) |
Construct a new array iterator from anything that has a hash table.
That is any Array or Object.
| $array | the array to use. |
| $flags | see setFlags(). |
| ArrayIterator::append | ( | $value | ) |
| $value | is appended as last element |
| ArrayIterator::count | ( | ) |
| ArrayIterator::current | ( | ) |
Return the current element.
Implements Iterator.
Definition at line 843 of file spl.php.
Referenced by RecursiveArrayIterator\getChildren(), and RecursiveArrayIterator\hasChildren().
| ArrayIterator::getArrayCopy | ( | ) |
| ArrayIterator::key | ( | ) |
| ArrayIterator::natcasesort | ( | ) |
Sort the entries by values using case insensitive "natural order" algorithm.
Definition at line 793 of file spl.php.
Referenced by SubClasses\current().
| ArrayIterator::natsort | ( | ) |
| ArrayIterator::next | ( | ) |
| ArrayIterator::offsetExists | ( | $index | ) |
| ArrayIterator::offsetGet | ( | $index | ) |
| ArrayIterator::offsetSet | ( | $index, | |
| $newval | |||
| ) |
| $index | index to set |
| $newval | new value to store at offset $index |
Implements ArrayAccess.
Definition at line 808 of file spl.php.
Referenced by SubClasses\__construct().
| ArrayIterator::offsetUnset | ( | $index | ) |
| $index | offset to unset |
Implements ArrayAccess.
| ArrayIterator::rewind | ( | ) |
| ArrayIterator::seek | ( | $position | ) |
| $position | offset to seek to |
| OutOfBoundsException | if $position is invalid |
Implements SeekableIterator.
| ArrayIterator::setFlags | ( | $flags | ) |
| ArrayIterator::uasort | ( | mixed | cmp_function | ) |
| ArrayIterator::uksort | ( | mixed | cmp_function | ) |
Sort the entries by key using user defined function.
Definition at line 785 of file spl.php.
Referenced by SubClasses\__construct().
| ArrayIterator::valid | ( | ) |
| const ArrayIterator::ARRAY_AS_PROPS = 0x00000002 |
| const ArrayIterator::STD_PROP_LIST = 0x00000001 |
1.8.5