Current Location: Home> Function Categories> touch

touch

Set file access and modification time
Name:touch
Category:File system
Programming Language:php
One-line Description:Set the file access and modification time.

Definition and usage

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

Example

 <?php
touch ( "test.txt" ) ;
?>

grammar

 touch ( filename , time , atime )
parameter describe
filename Required. Specify the documents to be contacted.
time Optional. Set the time. The default is the current system time.
atime Optional. Set the access time. The default is the current system time.

illustrate

Try to set the access and modification time of the file given by filename to the specified time. If no optional parameter time is set, the current system time is used. If the third parameter atime is given, the access time of the specified file will be set to atime.

Return true if successful, and false if failed.

Similar Functions