PHP – Move a file into a different folder on the server

The rename function does this docs rename rename(‘image1.jpg’, ‘del/image1.jpg’); If you want to keep the existing file on the same place you should use copy docs copy copy(‘image1.jpg’, ‘del/image1.jpg’); If you want to move an uploaded file use the move_uploaded_file, although this is almost the same as rename this function also checks that the given file is a file that was … Read more