You are here: Home » PHP » create folder in php

create folder in php

131 Flares 131 Flares ×

When have to upload file in php after create a folder/directory,
First check if folder/directory is created or not? To check it use

<?php 
 is_dir('uploads');
?>

for check any type of file use

<?php 
 is_dir('test.txt');
?>

To create folder use,

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

To give read wirtr permission use on folder
To create folder use,

<?php 
 mkdir('uploads', 0777, true);
?>

0777 usr for read write permission to folder.

About Abhishek Sinha

I am Abhishek and I love to code on PHP.

Leave a Reply

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

*

Scroll To Top
131 Flares Twitter 2 Facebook 10 Google+ 15 StumbleUpon 1 Pin It Share 100 LinkedIn 3 131 Flares ×