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

Loading comments...

Related Examples

Deliver breaking news, insightful commentary, and exclusive reports.

Targeting readers who rely on our platform to stay ahead of the curve.

Contact Us: benzingaheadlines@gmail.com