وظيفة PHP touch ()
❮ مرجع نظام ملفات PHPمثال
يضبط وقت الوصول والتعديل للملف المحدد:
<?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;
}
?>
التعريف والاستخدام
تعمل وظيفة اللمس () على ضبط وقت الوصول والتعديل للملف المحدد.
ملاحظة: إذا كان الملف المحدد غير موجود ، فسيتم إنشاؤه.
بناء الجملة
touch(filename, time, atime)
قيمه المعامل
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 |
تفاصيل تقنية
قيمة الإرجاع: | صواب في النجاح ، خطأ في الفشل |
---|---|
إصدار PHP: | 4.0+ |
سجل التغيير في PHP: | PHP 5.3 - |
❮ مرجع نظام ملفات PHP