Copies a file.
copy() copies a file and returns TRUE on success and FALSE if an error occurs.
<?php
copy("log.txt", "log2.txt");
$newfile = fopen("log2.txt", "r");
print fgets($newfile);
?> Sample code running The example logfile is copied to a new file and the first line of the new file is printed.