Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP touch() Function

PHP touch() Function


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual


Definition and Usage

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

Returns TRUE on success, or FALSE on failure.

Syntax

touch(filename,time,atime)

Parameters Description
filename Required. Specifies the file to touch.
time Optional. Sets the time. Defaults to the current system time.
atime Optional. Sets the 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.


Example


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual