Copying Files with copy( )

<?php
$filename = 'data.txt';
$filename2 = 'old_'.$filename;
$result = copy($filename, $filename2);
if ($result) {
print "$filename has been copied to $filename2.\n";
} else {
print "Error: couldn't copy $filename to $filename2!\n";
}
?>

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

Leave a Comment

Your email address will not be published. Required fields are marked *