PHP Scripting

Copy File

copy file from one directory to another using PHP

6/24/2020
0 views
copy-file.phpPHP
<?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!";
?>



/* Ouput */
File copied successfully!
PHPcopy file using PHPcopy functioncopy

Related Examples