How to modify the creation time of a file in php

藏色散人
Release: 2023-03-03 22:44:01
Original
2610 people have browsed it

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));
?>
Copy after login

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);
Copy after login

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)
Copy after login

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!

Related labels:
php
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