rename
rename
Renames a file or directory
bool **rename** string $from string $to $context
Attempts to rename to
, moving it between directories if necessary.
If renaming a file and exists,
it will be overwritten. If renaming a directory and
exists,
this function will emit a warning.
from``to``to``to
fromThe old name.
Opmerking: > The wrapper used in match the wrapper used in .
frommustto
to
The new name.
> **Opmerking:** > On Windows, if already exists, it must be writable.
Otherwise fails and issues . `to``rename``E_WARNING`
context
return.success
**Voorbeeld: Example with **
<?php
rename("/tmp/tmp_file.txt", "/home/user/login/docs/my_file.txt");
?>
copy``unlink``move_uploaded_file