पीएचपी स्पर्श () समारोह
❮ पीएचपी फाइल सिस्टम संदर्भउदाहरण
निर्दिष्ट फ़ाइल का उपयोग और संशोधन समय निर्धारित करता है:
<?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 |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर सत्य, असफलता पर असत्य |
---|---|
पीएचपी संस्करण: | 4.0+ |
पीएचपी चेंजलॉग: | पीएचपी 5.3 - |
❮ पीएचपी फाइल सिस्टम संदर्भ