$filename = basename($_FILES['file']['name']); $extension = pathinfo($filename,PATHINFO_EXTENSION); $new = md5($filename).'.'.$extension; if (move_uploaded_file($_FILES['file']['tmp_name'],"/path/{$new}")) { // other code }
$filename = basename($_FILES['file']['name']); $extension = pathinfo($filename,PATHINFO_EXTENSION); $new = md5($filename).'.'.$extension; if (move_uploaded_file($_FILES['file']['tmp_name'],"/path/{$new}")) { // other code }