title: what causes Warning: preg_match(): Unknown modifier 'p'
body: <p>I am having trouble I could not fix this error. I am using this upload script to check the mime type.</p>
  
  <blockquote>
    <p>Warning: preg_match(): Unknown modifier 'p'<br>
    Warning: preg_match(): Unknown modifier 'g'<br>
    Warning: preg_match(): Unknown modifier '('</p>
  </blockquote>
  
  <pre><code>if (preg_match('/^image/p?jpeg$/i', $_FILES['upload']['type']) or 
  
      preg_match('/^image/gif$/i', $_FILES['upload']['type']) or 
  
      preg_match('/^image/(x-)?png$/i', $_FILES['upload']['type'])) 
  
  { 
  
    // Handle the file... 
  
  } 
  
  else 
  
  { 
  
    $error = 'Please submit a JPEG, GIF, or PNG image file.'; 
  
    include $_SERVER['DOCUMENT_ROOT'] . '/includes/error.html.php'; 
  
    exit(); 
  
  }
  </code></pre>
  
  <p>Thank you in advance</p>