upload file move code example
Example 1: php move file
//Use the rename() function.
rename('first_location/image1.jpg', 'new_location/image1.jpg');
Example 2: move uploaded file in php
<?php
if (move_uploaded_file($_FILES['userfile']['tmp_name'], "/documents/new/")) {
print "Uploaded successfully!";
} else {
print "Upload failed!";
}
?>