PHP 8.5.0 RC 2 available for testing

ArrayIterator::rewind

(PHP 5, PHP 7, PHP 8)

ArrayIterator::rewind β€” Revient Γ  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