Make the following directory, “test”:
<?php mkdir(“test”); ?> |
A directory can be created by using the mkdir() function and a pathname.
mkdir(path, mode, recursive, context) |
Parameter |
Description |
path |
Essential. Gives the path of the directory to be created. |
mode |
Not required. details the permissions. The mode is 0777 (widest possible access) by default. · There is always zero for the first number. · Permissions for the owner are indicated by the second number. · The owner’s user group’s permissions are specified by the third number. · The fourth figure denotes permissions for all other parties. 1 = carry out authorizations |
recursive |
Not required. indicates whether the recursive mode (introduced in PHP 5) is enabled. |
context |
Not required. Indicates the file handle’s context. Context is a collection of parameters that can change a stream’s behavior (introduced in PHP 5) |
Return Value: |
FALSE when it fails, TRUE when it succeeds |
PHP Version: |
4.0+ |