Learn Codeigniter

Create Folder In PHP

To Create folder,we will use mkdir() function of PHP.

Syntax

mkdir(path,mode,recursive,context)
<?php
$dirName = "images";
if (!file_exists($dirName)) {
$result = mkdir($dirName, 0777);
if ($result) {
    echo $dirName . " has been created successfully.";
} else {
    echo $dirName . " has not been created.";
}
}
else
{
   echo $dirName . " directory is already exists.";
}
?>