Below is the code I used in order to upload files into a directory. It works fine. My main question is:
move_uploaded_file() is the one that saves t
/* create new name file */
$filename = uniqid() . "-" . time(); // 5dab1961e93a7-1571494241
$extension = pathinfo( $_FILES["file"]["name"], PATHINFO_EXTENSION ); // jpg
$basename = $filename . "." . $extension; // 5dab1961e93a7_1571494241.jpg
$source = $_FILES["file"]["tmp_name"];
$destination = "../img/imageDirectory/{$basename}";
/* move the file */
move_uploaded_file( $source, $destination );
echo "Stored in: {$destination}";