PHP का नाम बदलें () फ़ंक्शन
❮ पीएचपी फाइल सिस्टम संदर्भउदाहरण
एक निर्देशिका + एक फ़ाइल का नाम बदलें:
<?php
rename("images","pictures");
rename("/test/file1.txt","/home/docs/my_file.txt");
?>
परिभाषा और उपयोग
नाम बदलें () फ़ंक्शन फ़ाइल या निर्देशिका का नाम बदलता है।
वाक्य - विन्यास
rename(old, new, context)
पैरामीटर मान
Parameter | Description |
---|---|
old | Required. Specifies the file or directory to be renamed |
new | Required. Specifies the new name for the file or directory |
context | Optional. Specifies the context of the file handle. Context is a set of options that can modify the behavior of a stream |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर सत्य, असफलता पर असत्य |
---|---|
पीएचपी संस्करण: | 4.0+ |
पीएचपी चेंजलॉग: | पीएचपी 5.3.1: विंडोज़ में ड्राइव्स में फाइलों का नाम बदलने की अनुमति दें। पीएचपी 5.0: कुछ यूआरएल रैपर के साथ इस्तेमाल किया जा सकता है। |
❮ पीएचपी फाइल सिस्टम संदर्भ