In this tutorial, We will learn how to copy a file from one folder to another. You'll learn to copy images from one folder to another in PHP.
Example:
<?php
/* Store the path of source file */
$filePath = 'images/test.jpeg';
/* Store the path of destination file */
$destinationFilePath = 'copyImages/test.jpeg';
/* Copy File from images to copyImages folder */
if( !copy($filePath, $destinationFilePath) ) {
echo "File can't be copied!";
}
else {
echo "File has been copied!";
}
?>
Thanks, I hope it will help you.....