readdirRead entry from directory handle Description
string readdir
([ resource
$dir_handle
] )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
Return Values
Returns the entry name on success or Warning
This function may
return Boolean Examples
Example #1 List all entries in a directory
Please note the fashion in which readdir's
return value is checked in the examples below. We are explicitly
testing whether the return value is identical to (equal to and of
the same type as--see Comparison
Operators for more information)
<?php
Example #2 List all entries in the current directory and strip out . and ..
<?php See Also
|