title: Check file extension in upload form in PHP
body: <p>I check the file extension for upload or not uploaded. My example methods worked, but now I need to understand if my methods (using <code>pathinfo</code>) is true. Is there another better and faster way?</p>
  
  <pre><code>$filename = $_FILES['video_file']['name'];
  $ext = pathinfo($filename, PATHINFO_EXTENSION);
  if ($ext !== 'gif' || $ext !== 'png' || $ext !== 'jpg') {
      echo 'error';
  }
  </code></pre>