mb_substr_count
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
mb_substr_count — 统计字符串出现的次数
说明
统计子字符串 needle
出现在字符串 haystack
中的次数。
返回值
子字符串 needle
出现在 string haystack
中的次数。
更新日志
版本 | 说明 |
---|---|
8.0.0 |
现在 encoding 可以为 null。
|
示例
示例 #1 mb_substr_count() 示例
<?php
echo mb_substr_count("This is a test", "is"); // 输出 2
?>
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/function.mb-substr-count.php