Moving a file : rename « File Directory « PHP






Moving a file

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








Related examples in the same category

1.A file can be renamed with the rename() function
2.Moving Files with rename( )