Mega Code Archive
Categories
/
Php
/
Strings
Match the smallest number of characters starting with p and ending with t
$text = "pot post pat patent"; if ( preg_match( "/p.*?t/", $text, $array ) ) { print "
\n"; print_r( $array ); print "
\n"; } ?>