PHP 5 Directory Functions

Introduction to PHP Directory

Directory function allows you to get information about directories and their contents.


PHP Directory functions are part of PHP's core. No installation is required to use these functions.

PHP 5 Directory Functions

function Description
chdir () Change the current directory.
chroot () Change the root directory.
closedir () Close the directory handle.
dir () Returns an instance of the Directory class.
getcwd () Returns the current working directory.
opendir () Open the directory handle.
readdir () Return the entries in the directory handle.
rewinddir () Reset the directory handle.
scandir () Returns an array of files and directories in the specified directory.