- function recursive_mkdir($path) {
- if(strlen($path) > 0 && !file_exists($path)) {
- $path_array = explode('/', $path);
- unset($path_array[sizeof($path_array) - 1]);
- $father_path = implode('/', $path_array);
- recursive_mkdir($father_path);
- if(!file_exists($path)) {
- return mkdir($path);
- }
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/160520149605.html
来源: http://www.codesnippet.cn/detail/160520149605.html