根据您的个性需求进行定制 先人一步 抢占小程序红利时代
//3.创建文件
$filename = $path."\\2.txt";
$pattern = "/[\/,\*,<>,\?\|]/";
if (!preg_match($pattern,$filename)) {
//判断同名文件是否存在
if (!file_exists($filename)) {
//touch($filename)创建文件
if (touch($filename)) {
print_r("创建成功");
}else{
print_r("创建失败");
}
}else{
print_r("文件已经存在,请重新命名");
}
}else{
print_r("非法文件名");
}



