Deborah
0
Q:

php copy


<?php
$file = 'example.txt';
$newfile = 'example.txt.bak';

if (!copy($file, $newfile)) {
    echo "failed to copy $file...\n";
}
?>

4
<?php 
  
// Copying gfg.txt to geeksforgeeks.txt 
$srcfile = '/user01/Desktop/admin/gfg.txt'; 
$destfile = 'user01/Desktop/admin/geeksforgeeks.txt'; 
  
if (!copy($srcfile, $destfilefile)) { 
    echo "File cannot be copied! \n"; 
} 
else { 
    echo "File has been copied!"; 
} 
  
?> 
1

New to Communities?

Join the community