创建一个以当前日期命名的文件 d:m:Y
Makes a file named with current date d:m:Y
PHP
$file = fopen((string)date("d-m-Y").".php","w");
fwrite($file,'Body');
fclose($file);
正确创建名为 22-11-2015
的文件。
但是
$file = fopen((string)date("d:m:Y").".php","w");
fwrite($file,'Body');
fclose($file);
创建一个名为 23P826~3
!!!!.
的文件
为什么Ubuntu中的文件名不能设置:
?
首先,您可以查看 Wikipedia Filename page 了解更多信息。
从我的角度来看,文件和目录名称中应避免使用特殊字符,以避免不必要的压力...
PHP
$file = fopen((string)date("d-m-Y").".php","w");
fwrite($file,'Body');
fclose($file);
正确创建名为 22-11-2015
的文件。
但是
$file = fopen((string)date("d:m:Y").".php","w");
fwrite($file,'Body');
fclose($file);
创建一个名为 23P826~3
!!!!.
为什么Ubuntu中的文件名不能设置:
?
首先,您可以查看 Wikipedia Filename page 了解更多信息。
从我的角度来看,文件和目录名称中应避免使用特殊字符,以避免不必要的压力...