Simple php function to create directory in given path. This makes creating your directory easy and efficient.
function createFolder($path, $foldername) {
$filename = $path.'/'.$foldername;
if (!file_exists($filename)) {
mkdir($path.'/'.$foldername, 0777);
return true;
exit;
} else { return true; }
}
Pass your path in $path variable and the folder name in $foldername variable.
function createFolder($path, $foldername) {
$filename = $path.'/'.$foldername;
if (!file_exists($filename)) {
mkdir($path.'/'.$foldername, 0777);
return true;
exit;
} else { return true; }
}
Pass your path in $path variable and the folder name in $foldername variable.
No comments:
Post a Comment