Easy Tutorial
❮ Func Filesystem Feof Func String Str Pad ❯

PHP dir() Function

PHP Directory Reference Manual

Example

Using the dir() function:

Result:


Definition and Usage

The dir() function returns an instance of the Directory class. This function is used to read a directory, including the following:


Syntax

Parameter Description
directory Required. Specifies the directory to open.
context Optional.

Technical Details

Return Value: Returns an instance of the Directory class. Returns FALSE on failure.
PHP Version: 4.0+
--- ---
❮ Func Filesystem Feof Func String Str Pad ❯