$uploadfile = explode('.', $uploadfile);
If (count( $uploadfile)>1){
switch ( end( $uploadfile)){
case ('jpg'):
$format = 'jpg';
break;
// и тд
}
}else{
exit('format not found');
}
$uploadfile =md5(uniqid().time()).'.'.$format;
move_uploaded_file($_FILES['буквы']['tmp_name'], $uploadfile);