php move_file

Posted by w3diy - 1 year ago

PHP Move File from One Folder to Another Example

<?php

/* Store the path of source file */
$filePath = 'images/welcome.jpeg';


/* Store the path of destination file */
$destinationFilePath = 'copyImages/welcome.jpeg';

/* Move File from images to copyImages folder */

if( !rename($filePath, $destinationFilePath) ) {  
    echo "File can't be moved!";  
}  

else {  
    echo "File has been moved!";  
} 

?>