Php Move File To Another Directory

[Solved] Php Move File To Another Directory | Php - Code Explorer | yomemimo.com
Question : take files from one folder and move to another folder in php

Answered by : ankur-prajapati

$source_file = 'foo/image.jpg';
$destination_path = 'bar/';
rename($source_file, $destination_path . pathinfo($source_file, PATHINFO_BASENAME));

Source : https://stackoverflow.com/questions/19139434/php-move-a-file-into-a-different-folder-on-the-server | Last Update : Fri, 29 Oct 21

Question : php move file

Answered by : aashit-vyom

//Use the rename() function.
rename('first_location/image1.jpg', 'new_location/image1.jpg');

Source : https://stackoverflow.com/questions/19139434/php-move-a-file-into-a-different-folder-on-the-server | Last Update : Wed, 22 Jul 20

Question : php move file to another directory

Answered by : tiago-frana

rename('source', 'target');

Source : | Last Update : Sat, 23 Jul 22

Answers related to php move file to another directory

Code Explorer Popular Question For Php