array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'fr', ), 'this' => array ( 0 => 'arrayiterator.next.php', 1 => 'ArrayIterator::next', ), 'up' => array ( 0 => 'class.arrayiterator.php', 1 => 'ArrayIterator', ), 'prev' => array ( 0 => 'arrayiterator.natsort.php', 1 => 'ArrayIterator::natsort', ), 'next' => array ( 0 => 'arrayiterator.offsetexists.php', 1 => 'ArrayIterator::offsetExists', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'fr', 'path' => 'reference/spl/arrayiterator/next.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5, PHP 7, PHP 8)
ArrayIterator::next — Se déplace vers la prochaine entrée
Cette fonction ne contient aucun paramètre.
Aucune valeur n'est retournée.
Exemple #1 Exemple avec ArrayIterator::next()
<?php
$arrayobject = new ArrayObject();
$arrayobject[] = 'zero';
$arrayobject[] = 'one';
$iterator = $arrayobject->getIterator();
while($iterator->valid()) {
echo $iterator->key() . ' => ' . $iterator->current() . "\n";
$iterator->next();
}
?>
L'exemple ci-dessus va afficher :
0 => zero 1 => one