substr_count(string,substring,start,length)
它用于计算子字符串的数量
Sr.No | 参数 & Description |
---|---|
1 |
string 用于指定要检查的字符串 |
2 |
substring 它用于指定搜索的字符串 |
3 |
start 它指定在字符串中何时开始搜索 |
4 |
length 链接:https://www.learnfk.comhttps://www.learnfk.com/php/php-function-substr-count.html 来源:LearnFk无涯教程网 它指定字符串的长度 |
它返回字符串在字符串中出现的次数
<?php echo substr_count("sairamkrishna","krishna"); ?>
这将产生以下输出-
1
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)