String matches: ^ (begine)
<?php $string = "PHP is "; $pattern = "/^PHP/"; if(preg_match($pattern, $string)) print("Found a match!"); ?>