Copying a file : copy « File Directory « PHP






Copying a file

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








Related examples in the same category

1.Copying Files with copy( )
2.Copying files
3.Make a copy of a file: copy() function.
4.Using the copy() Function