Mega Code Archive
Categories
/
Php
/
Strings
Put the word boundary character to the test
$text = "pot post pat patent"; if ( preg_match( "/\bp\w+t\b/", $text, $array ) ) { print "
\n"; print_r( $array ); print "
\n"; } ?>