PHP touch() Function
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
Complete PHP Filesystem Reference Manual