CakeFest 2024: The Official CakePHP Conference

DirectoryIterator::rewind

(PHP 5, PHP 7, PHP 8)

DirectoryIterator::rewindRevient au début du dossier

Description

public DirectoryIterator::rewind(): void

Revient au début de l'objet DirectoryIterator.

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 DirectoryIterator::rewind()

<?php
$iterator
= new DirectoryIterator(dirname(__FILE__));

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

$iterator->rewind(); //rewinding to the beginning
echo $iterator->key(); //0
?>

Voir aussi

add a note

User Contributed Notes

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