Home >Backend Development >PHP Tutorial >自动创建二级目录,该如何解决

自动创建二级目录,该如何解决

WBOY
WBOYOriginal
2016-06-13 10:14:37798browse

自动创建二级目录
data下有两个文件夹 如果没有该目录自动创建 急需代码

------解决方案--------------------
if(!is_dir('/data/test')){
mkdir('/data/test');
}
......
------解决方案--------------------
if(!file_exists('data/test')){
mkdir('data/test');
}

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