dir

mixed dir(string dir) 

A pseudo-object-oriented wrapper for many of the directory functions.

Returns:

Resource pointer on success; FALSE for other cases

Description:

dir() is a pseudo-object-oriented wrapper for all the directory functions that work with directory streams. It is certainly one of PHP’s oddball functions—an early experiment in implementing object-oriented features for PHP. (See the notes for an anecdote from Jim Winstead, the author of the function.)

When the function is called, it opens a directory stream to directory dir and returns an object. When the directory stream is opened, a resource pointer for the stream is created. This pointer is stored as a class property called handle and the pathname of the directory is stored ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.