PHP 8.4.6 Released!

FilesystemIterator::rewind

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

FilesystemIterator::rewindRebobina hasta volver al inicio

Descripción

public FilesystemIterator::rewind(): void

Rebobinar el directorio hasta volver al inicio.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

No devuelve ningún valor.

Ejemplos

Ejemplo #1 Ejemplo de FilesystemIterator::rewind()

<?php
$iterator
= new FilesystemIterator(dirname(__FILE__), FilesystemIterator::KEY_AS_FILENAME);

echo
$iterator->key() . "\n";

$iterator->next();
echo
$iterator->key() . "\n";

$iterator->rewind();
echo
$iterator->key() . "\n";
?>

El resultado del ejemplo sería algo similar a:

manzana.jpg
banana.jpg
manzana.jpg

Ver también

add a note

User Contributed Notes

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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant