Home  >  Article  >  Backend Development  >  How to modify the creation time of a file in php

How to modify the creation time of a file in php

藏色散人
藏色散人Original
2020-08-07 09:41:312595browse

php method to modify file creation time: first create a PHP sample file; then enter the content "touch("test.txt",mktime(19,5,10,10,26,2013));" ;Finally execute the file in the browser.

How to modify the creation time of a file in php

Recommended: "PHP Video Tutorial"

php modify the creation time of the file

Change the last modified time of test.txt to 19:05:10 on October 26, 2013

<?php
touch("test.txt",mktime(19,5,10,10,26,2013));
?>

Related introduction:

mktime() function Returns the UNIX timestamp of a date.

Tip: This function is the same as gmmktime(), except that the parameter passed represents a date (not a GMT date).

Syntax

mktime(hour,minute,second,month,day,year,is_dst);

touch() function sets the access and modification time of the specified file.

If successful, this function returns TRUE. On failure, returns FALSE.

Grammar

touch(filename,time,atime)

The above is the detailed content of How to modify the creation time of a file in php. For more information, please follow other related articles on the PHP Chinese website!

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