What is Filesystem mkdir in PHP

In this article I am going to explain about mkdir function in PHP.
  • 1173

PHP mkdir() Function

The filesystem mkdir function creates a directory. The mkdir function returns true on success or false on failure.

Syntax of mkdir function     

mkdir(path, mode, recursive, context)

Parameters in mkdir function

It have four parameter:

Parameter Description
path Specifies directory path.
mode Specifies permissions and by default mode is 0777.
recursive It allows the creation of nested directories.
context It specifies the context of the file handle.

Example of filesystem mkdir function

<html>

<body>
 

<?php

mkdir("mydirectory");

echo "Directory created";

?>
 

</body>

</html>

 

Output:

mkdir-php-function.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.