PHP Preg_Match() Function Returns True If Pattern Exists, And False Otherwise. – String Function

 
Its syntax follows: int preg_match (string pattern, string string [, array pattern_array])<?
    $line = "virtual";
    if (preg_match("/\bVi\b/i", $line, $match)) :
         print "Match found!";
    endif;
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.