<?php $old = '/tmp/today.txt'; $new = '/tmp/tomorrow.txt'; rename($old,$new) or die("couldn't move $old to $new: $php_errormsg"); ?>