Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

PHP 5 Directory function


May 11, 2021 PHP


Table of contents


PHP 5 Directory function

In this section, you'll learn about PHP5's directory function: the Directory function.


Introduction to PHP Directory

The Directory function allows you to get information about the directory and its contents.


Installation

The PHP Directory function is part of the PHP core. These functions can be used without installation.


PHP 5 Directory function

function describe
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() Returns the entry in the directory handle.
rewinddir() Reset the directory segment.
scandir() Returns an array of files and directories in the specified directory.

With the Directory function, you can easily get information about the directory, and then you'll learn about PHP's Error and Logging functions!