PHP mkdir() function – Create Directory

PHP mkdir() Function

Create Directory in PHP

The mkdir() function is used to create a new directory in computer.

mkdir() function syntax




mkdir() function Exmaple




Above example we use mkdir() function to create directory named with “meera”.

The new directory created in the php script folder.

PHP form script example to create directory

<title>Create Directory in PHP</title>
<FORM method="POST">
Enter Directory Name : <input type="text" name="str"> <br/> <br/>
<input type="submit" name="Submit1" value="Create Directory">

echo "Directory Created.";

The output of create directory using mkdir() php example is:

PHP mkdir() function
PHP mkdir() function example for create directory.


Leave a Reply

Your email address will not be published. Required fields are marked *