Open a directory, read its contents, then close:
Result:
The opendir() function opens a directory handle.
Parameter | Description |
---|---|
path | Required. Specifies the directory path to be opened |
context | Optional. Specifies the context of the directory handle. Context is a set of options that can modify the behavior of a stream |
Return Value: | Returns the directory handle resource on success. FALSE on failure. Throws an error of level E_WARNING if path is not a valid directory, or if the directory cannot be opened due to permission restrictions or filesysytem errors. You can hide the error output of opendir() by adding '@' to the front of the function name |
---|---|
PHP Version: | 4.0+ |
PHP Changelog: | PHP 5.0: The path parameter now supports the ftp:// URL wrapper |