PHP touch() İşlevi
❮ PHP Dosya Sistemi ReferansıÖrnek
Belirtilen dosyanın erişim ve değişiklik zamanını ayarlar:
<?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;
}
?>
Tanım ve Kullanım
touch() işlevi, belirtilen dosyanın erişim ve değişiklik zamanını ayarlar.
Not: Belirtilen dosya mevcut değilse oluşturulacaktır.
Sözdizimi
touch(filename, time, atime)
Parametre Değerleri
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 |
Teknik detaylar
Geri dönüş değeri: | Başarıda DOĞRU, başarısızlıkta YANLIŞ |
---|---|
PHP Sürümü: | 4.0+ |
PHP Değişiklik Günlüğü: | PHP 5.3 - |
❮ PHP Dosya Sistemi Referansı