In this article, you will learn how to move a file to a new path in PHP. The move_uploaded_file() function in PHP moves an uploaded file to a new destination. If the file already exist in that path, it is replaced.
The move_uploaded_file() function only works with the files uploaded by PHP HTTP POST function.
what is the syntax of the MOVE_UPLOADED_FILE function in php?
move_uploaded_file(file, dest)
Parameter | Description |
---|---|
file | Required. Specifies the filename of the uploaded file |
dest | Required. Specifies the new location for the file |