PHP 8.3.4 Released!

ArrayIterator::rewind

(PHP 5, PHP 7, PHP 8)

ArrayIterator::rewindRevient à la position initiale

Description

public ArrayIterator::rewind(): void

Revient à la position initiale.

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Aucune valeur n'est retournée.

Exemples

Exemple #1 Exemple avec ArrayIterator::rewind()

<?php
$arrayobject
= new ArrayObject();

$arrayobject[] = 'zero';
$arrayobject[] = 'one';
$arrayobject[] = 'two';

$iterator = $arrayobject->getIterator();

$iterator->next();
echo
$iterator->key(); //1

$iterator->rewind(); // revient au début
echo $iterator->key(); //0
?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top