Use preg_match
Run php tidy.