Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP 5 Directory Functions

PHP 5 Directory Functions


PHP Directory Introduction

Directory functions allow you to obtain information about directories and their contents.


Installation

PHP Directory functions are part of the PHP core. These functions can be used without installation.


PHP 5 Directory Functions

function Description
chdir() Changes the current directory.
chroot() Changes the root directory.
closedir() Closes a directory handle.
dir() Returns an instance of the Directory class.
getcwd() Returns the current working directory.
opendir() Opens a directory handle.
readdir() Returns an entry from the directory handle.
rewinddir() Resets the directory handle.
scandir() Returns an array of files and directories in the specified directory.