<?php
$str = "SELECT";
$query = "SELECT * FROM table WHERE field = 1";
echo "Query begins with $str";
else
echo "Query DOES NOT begin with $str";
?>
PD9waHAKCiRzdHIgPSAiU0VMRUNUIjsKJHF1ZXJ5ID0gIlNFTEVDVCAqIEZST00gdGFibGUgV0hFUkUgZmllbGQgPSAxIjsKCmlmIChzdHJpcG9zKHRyaW0oJHF1ZXJ5KSwgJHN0cikgPT09IDApCiAgICBlY2hvICJRdWVyeSBiZWdpbnMgd2l0aCAkc3RyIjsKZWxzZQogICAgZWNobyAiUXVlcnkgRE9FUyBOT1QgYmVnaW4gd2l0aCAkc3RyIjsKCj8+