Mega Code Archive

 
Categories / Php / Strings
 

String match demo

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