问题
I have some problems with PHP Rename .
$rm = rename($path.$package."/",$path.$get["theme_name"]."/");
if ($rm == FALSE)
{
return "RENAME_FAILURE";
}
here i got a error
A PHP Error was encountered
Severity: Warning
Message: rename(/home/pr/public_html/developer/public_themes/arkGT/,/home/pr/public_html/developer/public_themes/new_roller/) [function.rename]: Directory not empty
Filename: models/pagemodel.php
Line Number: 218
i checked the cpanel,everything is ok,the folder is renamed to new_roller
...
then what is the problem with my code ?
Thank you.
回答1:
Try this :
$rm = rename("./public_themes/arkGT/","./public_themes/new_roller/");
if ($rm == FALSE)
{
return "RENAME_FAILURE";
}
else
{
return "success";
}
Your code is correct .
来源:https://stackoverflow.com/questions/9043193/php-rename-failure