Funzione PHP touch()
❮ Riferimento al file system PHPEsempio
Imposta l'ora di accesso e modifica del file specificato:
<?php
filename = "test.txt";
if (touch($filename)) {
echo
$filename . " modification time has been changed to present time";
} else {
echo "Sorry, could not change modification time of " . $filename;
}
?>
Definizione e utilizzo
La funzione touch() imposta il tempo di accesso e modifica del file specificato.
Nota: se il file specificato non esiste, verrà creato.
Sintassi
touch(filename, time, atime)
Valori dei parametri
Parameter | Description |
---|---|
filename | Required. Specifies the file to touch |
time | Optional. Sets the touch time. The current system time is set by default |
atime | Optional. Sets the access time. Default is the current system time if no parameters are set, or the same as the time parameter if that parameter is set |
Dettagli tecnici
Valore di ritorno: | VERO in caso di successo, FALSO in caso di fallimento |
---|---|
Versione PHP: | 4.0+ |
Registro delle modifiche PHP: | PHP 5.3 - |
❮ Riferimento al file system PHP