note 97347 added to function.rename
| From: | andrew at 21cv dot co dot uk | Date: | Thu, 15 Apr 2010 12:19:27 +0000 |
| Subject: | note 97347 added to function.rename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168264@lists.php.net to get a copy of this message | ||
Code first, then explanation.
<?php
rename ("/folder/file.ext", "newfile.ext");
?>
That doesn't rename the file within the folder, as you might assume, instead, it moves the file
to whatever the PHP working directory is... Chances are you'll not find it in your FTP tree.
Instead, use the following:
<?php
rename ("/folder/file.ext", "/folder/newfile.ext");
?>
----
Server IP: 78.110.173.36
Probable Submitter: 87.113.38.80
----
Manual Page -- http://www.php.net/manual/en/function.rename.php
Edit -- https://master.php.net/note/edit/97347
Del: integrated -- https://master.php.net/note/delete/97347/integrated
Del: useless -- https://master.php.net/note/delete/97347/useless
Del: bad code -- https://master.php.net/note/delete/97347/bad+code
Del: spam -- https://master.php.net/note/delete/97347/spam
Del: non-english -- https://master.php.net/note/delete/97347/non-english
Del: in docs -- https://master.php.net/note/delete/97347/in+docs
Del: other reasons-- https://master.php.net/note/delete/97347
Reject -- https://master.php.net/note/reject/97347
Search -- https://master.php.net/manage/user-notes.php