The mkdir() function creates a directory.
The function returns TRUE if successful and FALSE if failed.
mkdir(path,mode,recursive,context)
parameter | describe |
---|---|
path | Required. Specifies the name of the directory to be created. |
mode | Optional. Specify permissions. The default is 0777 (allow global access). The mode parameter consists of four numbers: The first number is usually 0 The second number specifies the owner's permissions The third number specifies the permissions of the user group to which the owner belongs The fourth number specifies everyone else's permissions Possible values (to set multiple permissions, total the numbers below): 1 = execute permission 2 = write permission 4 = Read permission |
recursive | Optional. Specifies whether to set recursive mode. (New in PHP 5) |
context | Optional. Specifies the environment for a file handle. context is a set of options that can modify the behavior of the stream. (New in PHP 5) |
Note: The mode parameter is ignored on Windows platforms.
<?phpmkdir("testing");?>