<?php $string_to_search = "yuncode.net"; $regex = "/tor/"; $num_matches = preg_match($regex, $string_to_search); if ($num_matches > 0) { echo "Found a match!"; } else { echo "No match. Sorry."; } ?>