php how to rename a file before saving it

Solutions on MaxInterview for php how to rename a file before saving it by the best coders in the world

showing results for - "php how to rename a file before saving it"
Michela
02 Mar 2016
1$temp = explode(".", $_FILES["file"]["name"]);
2$newfilename = round(microtime(true)) . '.' . end($temp);
3move_uploaded_file($_FILES["file"]["tmp_name"], "../img/imageDirectory/" . $newfilename);