PHP uses mkdir () to create multi-level catalogs that are very useful when compared to a previous level of creation.
The following is a description of the functions in the PHP manual:
mkdir string $pathname $mode $recursive false Resource $context ]] )
The return value is type bool.
First parameter: must, represents the path of the multilevel directory to be created;
The second parameter: Set the permissions of the directory, the default is 0777, which means the maximum possible access rights;
The third parameter: True indicates that a multilevel directory is allowed to be created.
Note: You can create a Chinese catalog
mkdir (iconv$path), 0777,true);
Need to use Iconv transcoding
<?PHPHeader("Content-type:text/html;charset=utf-8"); //the multilevel directory to create $path= "dai/php/php Learning"; //determine if the directory exists no, there is a hint, does not exist to create the directory if(Is_dir($path)){ EchoSorry Directory ".$path. "Already exists! "; }Else{ //The third parameter is "true" to indicate that you can create a multilevel directory, iconv prevent Chinese directory garbled $res=mkdir(Iconv("UTF-8", "GBK",$path), 0777,true); if($res){ EchoThe catalog$pathCreate successful "; }Else{ EchoThe catalog$pathCreate Failed "; } }?>
How PHP uses mkdir to create multilevel catalogs