use this method and then if you try to use read (), you will start from the 1st item in the directory object
(PHP 4, PHP 5, PHP 7)
Directory::rewind — Rewind directory handle
$dir_handle
= ?
) : void
Same as rewinddir(), only
dir_handle
defaults to $this->handle.
use this method and then if you try to use read (), you will start from the 1st item in the directory object