title: php preg_match starts with keyword
body: <p>Surely an easy problem, but I can't get is solved...</p>
  
  <p>I just want to detect if my sql query is starting with a "select" or anything else.
  This code seems not to work :</p>
  
  <pre><code>if (preg_match("/^(select)/i", $sql) &gt; 0)
  {
  // SELECT query
  }
  else
  {
  // other query
  }
  </code></pre>
  
  <p>Thanks for your help !</p>
  
  <p>[EDIT]
  Ok, I have the root cause: 
  I may have spaces, tabs and line returns before the keyword "select"...</p>