move_uploaded_file

It moves an uploaded file to a new location. It is used to validate whether the contents of $_FILES[‘name’][‘tmp_name’] have really been uploaded via HTTP, and also save the contents into another folder.

Example

<?php
 move_uploaded_file($tmp_name, $_FILES["file"]["name"]) or die("Failed");
?>