fork(10) download
  1. <?php
  2.  
  3. $str = "SELECT";
  4. $query = "SELECT * FROM table WHERE field = 1";
  5.  
  6. if (preg_match("/^select (.*)/i", trim($query)) > 0)
  7. echo "Query begins with $str";
  8. else
  9. echo "Query DOES NOT begin with $str";
  10.  
  11. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
Query begins with SELECT