PHP String Match Demo: /[Cd][Oa][Gt]/ – String Function

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

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.