substr_count

substr_count

(PHP 4, PHP 5, PHP 7)

substr_countCount the number of substring occurrences

Description

int substr_count ( string $haystack , string $needle [, int $offset = 0 [, int $length ]] )

substr_count() returns the number of times the needle substring occurs in the haystack string. Please note that needle is case sensitive.

Note:

This function doesn't count overlapped substrings. See the examp