Create folder using php

create folder using php
PHP

Create folder using php

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 Reply

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

Back To Top