PHP إعادة تسمية () الوظيفة
❮ مرجع نظام ملفات PHPمثال
إعادة تسمية دليل + ملف:
<?php
rename("images","pictures");
rename("/test/file1.txt","/home/docs/my_file.txt");
?>
التعريف والاستخدام
تقوم وظيفة rename () بإعادة تسمية ملف أو دليل.
بناء الجملة
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 |
تفاصيل تقنية
قيمة الإرجاع: | صواب في النجاح ، خطأ في الفشل |
---|---|
إصدار PHP: | 4.0+ |
سجل التغيير في PHP: | PHP 5.3.1: السماح بإعادة تسمية الملفات عبر محركات الأقراص في Windows. PHP 5.0: يمكن استخدامه مع بعض أغلفة عناوين URL. |
❮ مرجع نظام ملفات PHP