PHP Match Smallest Number Of Characters Starting With “P” And Ending With “T” – String Function

<?
$text = "pot post pat patent";
if ( preg_match( "/p.*?t/", $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.