PHP is_dir() Function
Complete PHP Filesystem Reference Manual
Definition and Usage
The is_dir() function checks whether the specified file is a directory.
Returns TRUE if the directory exists.
Syntax
is_dir(file)
| Parameters | Description |
|---|---|
| file | Required. Specifies the file to check. |
Tips and Notes
**Note:** The results of this function are cached. Use clearstatcache() to clear the cache.
Example
The code above will output:
images is a directory
Complete PHP Filesystem Reference Manual