Copy the code The code is as follows:
function mkdirs($dir, $mode = 0777)
{
If (is_dir($dir) || @mkdir($dir, $mode)) return TRUE;
If (!mkdirs(dirname($dir), $mode)) return FALSE;
Return @mkdir($dir, $mode);
}
mkdirs("aa01");
The default mode is 0777, which means maximum possible access. For more information about mode please read the chmod() page.