rewinddir
PHP function
Edit on GitHub ✎
(PHP 4, PHP 5, PHP 7, PHP 8)
Rewind directory handle
Description
rewinddir(resource|null $dir_handle = null): void
Resets the directory stream indicated by dir_handle to the beginning of the directory.
Parameters
dir_handleA directory handle
resourcepreviously opened withopendir(). Ifdir_handleis null the last handle opened usingopendir()will be used.
Return Values
Void
Changelog
| Version | Description |
|---|---|
| 8.5.0 | Using null for dir_handle is now deprecated. Instead, the last opened directory handle should be explicitly provided. |
| 8.0.0 | dir_handle is now nullable. |
Examples
For a complete example refer to the opendir() documentation.