Simple rename() function not working on server.
$val = "dir/1.txt";
$rval = "dir2/2.txt";
$test=rename($val, $rval);
if($test){
echo "<br>Rename working";
}
else{
echo "<br>Rename not working";
}
I am actually trying to move file to different directory using rename. What could be the reason?
rename
returns false on failure. This could be for any number of reasons in your code.
etc...