ユーザーが画像をアップロードできるようにするスクリプトを作成していますが、今は gif と png のみを受け入れる単純な if ステートメントを含めたいと考えています。これが私のコードですが、必要な方法で機能していないようです。
#extention filter
$allowed = array("image/gif","image/png");
if(!in_array($files,$allowed)){
$error_message = 'Only jpg, gif, and pdf files are allowed.';
$error = 'yes';
echo $error_message;
exit();
} #extention