Home >Backend Development >PHP Tutorial > php 创建文件夹异常

php 创建文件夹异常

WBOY
WBOYOriginal
2016-06-13 13:04:01817browse

php 创建文件夹错误

D:\work3\sinykkphp\includes\upload\userfile/2011/01/12/create dir


Warning : mkdir() [function.mkdir ]: No such file or directory in D:\work3\sinykkphp\test-sinykk.php on line 13

?

?

mkdir($path,0777);? 不能同时建两级目录

?

要用循环一个一个建目录如

?

$i = 0;
while (!@mkdir($path, 0777)) {
 if (is_dir($path)) break;
 $i ++; 
 if (@mkdir($path . str_repeat("/..", $i), 0777)) $i = 0;
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn