touchFile.php
Table of Contents
Functions
- touchFile() : string
- Creates a file if it does not exist, or updates its modification and access times.
Functions
touchFile()
Creates a file if it does not exist, or updates its modification and access times.
touchFile(string $file[, int|null $mtime = null ][, int|null $atime = null ][, bool $createDirectory = true ]) : string
Thin, exception-throwing wrapper around touch(). When $mtime is null, the
current time is used. When $mtime is given but $atime is null, the access
time is set to $mtime as well. The parent directory is created on demand.
Parameters
- $file : string
-
Path to the file to touch.
- $mtime : int|null = null
-
Modification timestamp (default:
null→ current time). - $atime : int|null = null
-
Access timestamp (default:
null→ same as$mtime). - $createDirectory : bool = true
-
Whether to create the parent directory if missing (default:
true).
Tags
Return values
string —The file path.