php copy overwrite
snippet in php

php copy overwrite

user9735

<?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!"; 
} 
  
?>