note 18896 deleted from function.rename by cmb
| From: | cmb@php.net | Date: | Sun, 22 Dec 2019 09:06:45 +0000 |
| Subject: | note 18896 deleted from function.rename by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213592@lists.php.net to get a copy of this message | ||
Note Submitter: blujay
----
You can always chdir() to the parent directory of what you're renaming, and rename the
directory or file directly. For example:
$oldWD = getcwd();
chdir($dirWhereRenameeIs);
rename($oldFilename, $newFilename);
chdir($oldWD);