note 111603 added to function.rename
| From: | bcag2 at free dot fr | Date: | Thu, 07 Mar 2013 15:40:00 +0000 |
| Subject: | note 111603 added to function.rename | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-193977@lists.php.net to get a copy of this message | ||
on windows (XP, vista, 7...) http://fr.wikipedia.org/wiki/Windows-1252",
if your file name contains accent, it doesn't work basically. So use iconv function to convert
from utf-8 to cp1252 as bellow :
<?php
$nomfichierinitial=iconv("UTF-8", "CP1252",
"C:\\wamp\\www\\tést.txt");
$nomfichierfinal="C:\\wamp\\www\\test.txt";
rename($nomfichierinitial, $nomfichierfinal);
?>
----
Server IP: 69.147.83.199
Probable Submitter: 134.158.82.37
----
Manual Page -- http://php.net/manual/en/function.rename.php
Edit -- https://master.php.net/note/edit/111603
Del: integrated -- https://master.php.net/note/delete/111603/integrated
Del: useless -- https://master.php.net/note/delete/111603/useless
Del: bad code -- https://master.php.net/note/delete/111603/bad+code
Del: spam -- https://master.php.net/note/delete/111603/spam
Del: non-english -- https://master.php.net/note/delete/111603/non-english
Del: in docs -- https://master.php.net/note/delete/111603/in+docs
Del: other reasons-- https://master.php.net/note/delete/111603
Reject -- https://master.php.net/note/reject/111603
Search -- https://master.php.net/manage/user-notes.php