$: anchors a pattern to the end of a line or the end of the string
<?php $string = " is PHP"; $pattern = "/PHP$/"; if(preg_match($pattern, $string)) print("Found a match!"); ?>