Make the directory in php basic



/********************************************************************************/
/* TITLE : Make the directory in php basic
/* DESCRIPTION : To Make the directory in php basic
/* CREATED BY   : Jemiris Selvi S
/* CREATED ON : 12-July-2017
/* MODIFIED BY : Jemiris Selvi S
/* MODIFIED ON : 12-july-2017
/********************************************************************************/

To make the directory dynamically if the directory exists it will not be created, otherwise it will create the directory dynamically where this code have been used.

<?php

// Desired folder structure
$structure = "http://localhost:70/test";

// To create the nested structure, the $recursive parameter
// to mkdir() must be specified.

if(!file_exists($structure))
{
die("Failed to create the floders");
}
else
{
mkdir('directory_name', 0777, true);
echo "File created success";
}

?>