title: How to check mimetype from uploaded file in php
body: <p>i have an mimetype check in my upload function, that checking if the uploaded file is an image or not.
  I want to allow upload image AND pdf files, but i dont know how to change my function.</p>
  
  <pre><code>$verifyimg = getimagesize($_FILES['image']['tmp_name'][$f]);
              $pattern = "#^(image/)[^\s\n&lt;]+$#i";
              if(!preg_match($pattern, $verifyimg['mime']))
              {
                  $err;
              }
  </code></pre>
  
  <p>I hope anybody can tell me how i need to change the $pattern varaible to check images AND pdf files.</p>
  
  <p>Have a nice weekend!</p>