<?php $string = "PHP is great!"; $pattern = "/P.P/"; if(preg_match($pattern, $string)) print("Found a match!"); ?>