Define :
In this tutorial we have to learned about PHP touch() Function.The touch() Function inbuilt function in php.This function is used to sets access and modification time of a file. it returns True on success and False on failure.
touch(filename, time, atime)
Parameter | Description |
---|---|
filename | It is a mandatory parameter which specifies the filename of the file whose access and modification time have to be changed. |
time | It is an optional parameter which specifies the time.By default it takes the current system time. |
atime | It is an optional parameter which specifies the access time. By default it takes the current system time if no parameters are set. |
Given below example show the usage of PHP touch() Function :
Output : demo.txt modification time changed to present time