As already mentioned, you will have to count the number of matches. This can be done with
PHP: preg_match_all - Manual[
^] which returns the number of matches:
<?php.
$string = 'sasa sasa';.
$count = preg_match_all('/sasa/', $string, $matches);
echo "sasa is mentioned $count times\n";.
?>