The directory functions allow you to retrieve information about directories and their contents.
The directory functions are part of the PHP core. There is no installation needed to use these functions.
PHP: indicates the earliest version of PHP that supports the function.
| Function | Description | PHP |
|---|---|---|
| chdir() | Changes the current directory | 3 |
| chroot() | Changes the root directory of the current process | 4 |
| dir() | Opens a directory handle and returns an object | 3 |
| closedir() | Closes a directory handle | 3 |
| getcwd() | Returns the current directory | 4 |
| opendir() | Opens a directory handle | 3 |
| readdir() | Returns an entry from a directory handle | 3 |
| rewinddir() | Resets a directory handle | 3 |
| scandir() | Lists files and directories inside a specified path | 5 |
PHP: indicates the earliest version of PHP that supports the constant.
| Constant | Description | PHP |
|---|---|---|
| DIRECTORY_SEPARATOR | 3 | |
| PATH_SEPARATOR | 4 |
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|