The code is taken from thinkphp:
function mk_dir($dir, $mod = 0777)
{
if(!is_dir($dir) || mkdir($dir, $mod))
{
if(!mk_dir(dirname($dir, $mod)))
{
return false;
}
}
return mkdir($dir, $mod);
}
Principle: Just keep trying to create upper-level directories, and so on
http://www.bkjia.com/PHPjc/738510.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/738510.htmlTechArticleThe code is taken from thinkphp: function mk_dir($dir, $mod = 0777) { if(!is_dir($ dir) || mkdir($dir, $mod)) { if(!mk_dir(dirname($dir, $mod))) { return false; } } return mkdir($dir, $mo...