来自AI助手的总结
substr_count() 函数用于计算子串在指定字符串中出现的次数。
PHP substr_count() 函数
定义和用法
substr_count() 函数计算子串在字符串中出现的次数。
语法
substr_count(string,substring,start,length)
| 参数 | 描述 |
|---|---|
| string | 必需。规定要检查的字符串。 |
| replacement | 必需。规定要插入的字符串。 |
| start | 可选。规定在字符串中何处开始搜索。 |
| charlist | 可选。规定搜索的长度。 |
例子
输出:
2
© 版权声明
THE END








暂无评论内容