Skip to content
Advertisement

how to rename folder in PHP The system cannot find the file specified. (code: 2)

If I change the site name, I want the folder name to change, how can I do that? i think this is changing the filename

$OldNameFolder=$path.$OldName;
$NewNameFolder=$path.$NewName;
rename('$OldNameFolder','$NewNameFolder');

Advertisement

Answer

Try remove variables in string

rename($OldNameFolder,$NewNameFolder);
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement