String match demo: |
<?php $string = "Cats coat dog date dig daughter catagory"; $pattern = "/cat|dog/"; if(preg_match($pattern, $string)) print("Found a match!"); ?>