PHP » I/O » opendir()

Syntax:
int opendir(string dir)
dir
Directory to open.

Returns a handle to a directory.

Directory handles can be used to find the contents of a directory. opendir() returns a directory handle, or FALSE if an error occurs.

Examples

Code:
<?php

if ($dh = opendir("upload")) {
   print "Directory successfully opened";
} else {
   print "Permission denied, or directory does not exist.";
}

?>
Output:
Directory successfully opened
Explanation:

A directory handle to "upload" is acquired.

See Also: