English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Provide these functions to operate any directory.
These functions can be used without installation. They are part of the PHP core.
It is necessary to use--enable-chroot-The func option must be configured in PHP to enable the chroot() function.
Version-Indicates the earliest version of PHP that supports this function.
Number | Constant | Description | Version |
---|---|---|---|
1 | DIRECTORY_SEPARATOR | Command to display system separator, path separator, in Linux it is/,in Windows it is \\ | 3 |
2 | PATH_SEPARATOR | Using multiple paths to include In Windows, when you include multiple paths, use ';' to separate them, and use ':' to separate them in Linux. | 4 |
Version-Indicates the earliest version of PHP that supports this function.
Number | Function name | Function description | Version |
---|---|---|---|
1 | chdir() | Change the current directory | 4 |
2 | chroot() | Change the root directory | 4.0.4 |
3 | dir() | Open directory handle and return an object | 4 |
4 | closedir() | Close directory | 4 |
5 | getcwd() | Get the current working directory | 4 |
6 | opendir() | Open directory handle | 4 |
7 | readdir() | Read entries from the directory handle | 4 |
8 | rewinddir() | Reset the directory handle created by opendir(). | 4 |
9 | scandir() | List files and directories within the specified path | 5 |
Note -For more file system functions, please seeFile system function