$fileRedictory = 'a/b/c/d/e/f/g'; if(!is_dir($fileRedictory)){ $find = explode('/', $fileRedictory); $newdir = ''; foreach($find as $k=>$v){ $newdir .= $k==0?$v:'/'.$v; if(!is_dir($newdir)){ mkdir($newdir); } } }
转载于:https://www.cnblogs.com/cyxxzjp/p/8330132.html