Home > Backend Development > PHP Tutorial > PHP 依据日期生成目录,检测目录存在,不存在自动建目录

PHP 依据日期生成目录,检测目录存在,不存在自动建目录

WBOY
Release: 2016-06-13 13:20:33
Original
990 people have browsed it

PHP 根据日期生成目录,检测目录存在,不存在自动建目录
$path=date("Y-m-d");  //获取当前时间


if(file_exists($path)) rmdir($path);  //检测变量中的文件夹是否存在,如果存在,删除

{
mkdir($path,0777);         //创建文件夹

}



echo $path;


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template