PHP Finding Matches Globally With Preg_Match_All() – String Function

<?
$text = "take, tart, till";
if ( preg_match( "/\bt\w+s\b/", $text, $array ) ) {
  print "<pre>\n";
  print_r( $array );
  print "

\n”;
}
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.