PHP Function Touch
A php function is a code block that performs a specific task. The php language includes built-in functions for all sorts of tasks such as manipulating text, reading files, sending email messages and processing images. Functions are useful because they allow you to wrap code that is used repeatedly in a single location. This streamlines your program and makes it easier to read. It also makes it easier to debug errors when they occur because you can pinpoint the exact function where the error is occurring.
Functions can accept multiple parameters which are passed to the function at runtime. Each parameter has a specific type and value. The parameter’s type and value are then interpolated into the function’s code. This process is known as scoping.
In addition to having a specific type, a parameter must be passed by reference (using an ampersand &) or by value. Passing by reference creates a new entry in the PHP symbol table which references an internal data structure that contains the variable’s value.
Passing by value creates a copy of the variable’s state. Therefore, if the function calls itself again, it will have a fresh copy of the original variable’s value.
The php function touch sets the access and modification time of a file. The name of the file, access time and modification time are passed as parameters. If the atime or mtime parameters are not passed, the system time is used. The function returns true on success or false on failure.