array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'directoryiterator.rewind.php', 1 => 'DirectoryIterator::rewind', 2 => 'Rewind the DirectoryIterator back to the start', ), 'up' => array ( 0 => 'class.directoryiterator.php', 1 => 'DirectoryIterator', ), 'prev' => array ( 0 => 'directoryiterator.next.php', 1 => 'DirectoryIterator::next', ), 'next' => array ( 0 => 'directoryiterator.seek.php', 1 => 'DirectoryIterator::seek', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/directoryiterator/rewind.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

DirectoryIterator::rewind

(PHP 5, PHP 7, PHP 8)

DirectoryIterator::rewindRewind the DirectoryIterator back to the start

Опис

public DirectoryIterator::rewind(): void

Rewind the DirectoryIterator back to the start.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Не повертає значень.

Приклади

Приклад #1 DirectoryIterator::rewind() example

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

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

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

Прогляньте також