How to create folder using php.

Use mkdir() function to create new folder using php.

<?php
     mkdir('foldername');
?>

We can also specify the full path to create folder as follows,

<?php
     mkdir('C:/xampp/htdocs/foldername', 0777);
?>

Here 0777 is specified to give the permission. Click here to check more about file permissions.

For more php related queries check this link

Leave A Comment