Extra Features in Php Regular Expressions

Google+ Pinterest LinkedIn Tumblr +

 <?php
   if (preg_match(“/(one).*(two)/”, “This is one and that is two.”, $matches))
     echo “Matched” . “
   else
     echo “Not Matched” . “

   echo $matches[0] . “
   echo $matches[1] . “
   echo $matches[2] . “
 ?>
 

Share.

About Author

Leave A Reply