Get Website Learn Coding Tech Story

PHP Programming Examples

<?php
	$source = "text.php";
   $destination = "test/newText.php";
	
	/* Copy file using copy()) */
   if(copy($source, $destination))
      echo "File copied successfully.";
   else
      echo "File could not be copied...Please try again!";
?> 


          /****** Output ******/
          

File copied successfully!

Learn more about copy()