PHP.nl

mb_substr_count

mb_substr_count

Count the number of substring occurrences

int **mb_substr_count** string $haystack string $needle  $encoding

Counts the number of times the substring occurs in the . needle``haystack``string

haystack The being checked. string

needle The being found. string

encoding

The number of times the substring occurs in the . needle``haystack``string

Voorbeeld: example

<?php
echo mb_substr_count("This is a test", "is"); // prints out 2
?>

mb_strpos``mb_substr``substr_count