1 2 3 4 5 6
function preg_match_count($pattern, $input) { if(preg_match_all($pattern, $input, $matches, PREG_PATTERN_ORDER)) { return count($matches[0]); } return 0; }
Sign in to leave a comment.