PHP touch() Functie
❮ Referentie voor PHP-bestandssysteemVoorbeeld
Stelt de toegangs- en wijzigingstijd van het opgegeven bestand in:
<?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;
}
?>
Definitie en gebruik
De functie touch() stelt de toegangs- en wijzigingstijd van het opgegeven bestand in.
Opmerking: als het opgegeven bestand niet bestaat, wordt het gemaakt.
Syntaxis
touch(filename, time, atime)
Parameterwaarden
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 |
Technische details
Winstwaarde: | WAAR bij succes, ONWAAR bij mislukking |
---|---|
PHP-versie: | 4.0+ |
PHP-wijzigingslogboek: | PHP 5.3 - |
❮ Referentie voor PHP-bestandssysteem