readdir
(PHP 4, PHP 5, PHP 7, PHP 8)
readdir — Read entry from directory handle
Description
Returns the name of the next entry in the directory.
The entries are returned in the order in which they are stored by
the filesystem.
Parameters
dir_handle
-
A directory handle resource previously opened
with opendir().
If dir_handle is null the last handle opened
using opendir() will be used.
Return Values
Returns the entry name on success, or false on failure.
WarningThis function may
return Boolean false, but may also return a non-Boolean value which
evaluates to false. Please read the section on Booleans for more
information. Use the ===
operator for testing the return value of this
function.
Examples
For a complete example refer to the opendir()
documentation.
See Also
- opendir() - Open directory handle
- rewinddir() - Rewind directory handle
- closedir() - Close directory handle
- dir() - Return an instance of the Directory class
- is_dir() - Tells whether the filename is a directory
- glob() - Find pathnames matching a pattern
- scandir() - List files and directories inside the specified path