How to Copy file from one folder to another folder using PHP

To copy files from source folder to destination php provide a copy function. This function takes two argument first is source path (source dir) and destination path (destination dir) and copy files from source to destination path. You may also like How to rename file using PHP and How to get file size in PHP

Code

$source = 'source/apple.png';
$destination = 'destination/apple.png';
copy($source, $destination);

Leave a Reply

Your email address will not be published. Required fields are marked *