PHP » I/O » mkdir()

Syntax:
bool mkdir(string dir, int permissions)
dir
The new directory.
permissions
Octal number specifying permissions for the new directory.

Creates a new directory.

mkdir() creates a directory with the specified permissions. The permissions are of the same form as for chmod() and fileperms(). TRUE is returned on success. If an error occurs, FALSE is returned.

Examples

Code:
<?php

if (mkdir("temp", 0701))
   print "Directory created";

?>
Output:
Directory created
Explanation:

Creates a directory with full permissions for the owner, and only the "x" bit set for others.

See Also: