mb_substr_count

(PHP 4 = 4.3.0)

mb_substr_count -- 副文字列の出現関数を数える

説明

int mb_substr_count ( string haystack, string needle [, string encoding])

substr_count() は、文字列 haystack の中での副文字列 needle の出現回数を返します。

encoding は、 needle haystack に対する 文字エンコーディングを指定します。省略された場合は、 内部文字エンコーディングが使用されます。

例 1 mb_substr_count() の例

 ?php
print mb_substr_count("これはてすとです。", "す"); // 2 を出力する
? 


substr_count() , mb_strpos() , mb_substr() も参照下さい。