substr_count - 语法
substr_count(string,substring,start,length)
它用于计算子字符串的数量
| Sr.No | 参数 & Description |
|---|---|
| 1 |
string 用于指定要检查的字符串 |
| 2 |
substring 它用于指定搜索的字符串 |
| 3 |
start 它指定在字符串中何时开始搜索 |
| 4 |
length 它指定字符串的长度 |
substr_count - 返回值
它返回字符串在字符串中出现的次数
substr_count - 示例
<?php echo substr_count("sairamkrishna","krishna"); ?>
这将产生以下输出-
1