Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

PHP Directory

PHP Directory Introduction

The directory functions enable you to obtain information about directories and their contents.

Installation

The PHP directory functions are built into the PHP core, so no additional installation is needed to use them.

PHP Directory Functions

 

Function

Description

chdir()

Changes the current working 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 a directory handle.

rewinddir()

Resets a directory handle.

scandir()

Returns an array of files and directories within a specified directory.