php method to modify file creation time: first create a PHP sample file; then enter the code as "touch("test.txt",mktime(19,5,10,10,26,2013)); "; Finally execute the file.
Recommended: "PHP Video Tutorial"
php modified file creation time:
For example:
Change the last modification time of test.txt to 19:5:10 on October 26, 2013
<?php touch("test.txt",mktime(19,5,10,10,26,2013)); ?>
touch() function sets the specified file Access and modification times.
If successful, this function returns TRUE. On failure, returns FALSE.
Syntax
touch(filename,time,atime)
Parameters
filename required. Specifies the files to be contacted.
time Optional. Set time. The default setting is the current system time.
atime Optional. Set access time. If the parameter is not set or is set to the same value as the time parameter, it defaults to the current system time.
Tips and Notes
Note: If the specified file does not exist, it will be created.
The above is the detailed content of How to modify file creation time in php. For more information, please follow other related articles on the PHP Chinese website!