Its syntax is: bool rename (string oldname, string newname) <? $data_file = "data.txt"; rename($data_file, $data_file.'.old') or die("Could not rename $data_file"); ?>