class Upload {
public function upload($uploadDir, $file) {
$pathToUpload = $uploadDir . basename($file['name']);
if( move_uploaded_file($file['tmp_name'], $pathToUpload) ) {
return $pathToUpload;
}
return false;
}
}
class Upload {
public function upload($uploadDir, $file) {
$pathToUpload = $uploadDir . "bla-bla-bla." . pathinfo($file, PATHINFO_EXTENSION);
if( move_uploaded_file($file['tmp_name'], $pathToUpload) ) {
return $pathToUpload;
}
return false;
}
}