Mega Code Archive

 
Categories / Php / Strings
 

A simple use of preg_match()

<?php      $string = "PHP is the web scripting language";      $pattern = "/PHP/";          if(preg_match($pattern, $string))           print("Found a match!"); ?>