Profile image for Cory Borrow coryborrow
Returns the count of matches of a pattern string against the input string.
Language
PHP
Tags
count match php preg

preg_match_count

1 function preg_match_count($pattern, $input) { 2 if(preg_match_all($pattern, $input, $matches, PREG_PATTERN_ORDER)) { 3 return count($matches[0]); 4 } 5 return 0; 6 }

Comments