位置: - 正文

PHP:mb_substr_count()的用法_mbstring函数

编辑:rootadmin
mb_substr_count

推荐整理分享PHP:mb_substr_count()的用法_mbstring函数,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 4 >= 4.3.0, PHP 5)

mb_substr_count — 统计字符串出现的次数

说明 int mb_substr_count ( string $haystack , string $needle [, string $encoding = mb_internal_encoding() ] )

统计子字符串 needle 出现在字符串 haystack 中的次数。

参数

haystack

要检查的字符串。

needle PHP:mb_substr_count()的用法_mbstring函数

待查找的字符串。

encoding

encoding参数为字符编码。如果省略,则使用内部字符编码。

返回值

子字符串 needle 出现在字符串 haystack 中的次数。

范例

Example #1 mb_substr_count() 例子

<?phpechomb_substr_count("Thisisatest","is");//输出2?>

参见

mb_strpos() - 查找字符串在另一个字符串中首次出现的位置 mb_substr() - 获取字符串的部分 substr_count() - 计算字串出现的次数

PHP:mb_strwidth()的用法_mbstring函数 mb_strwidth(PHP4=4.0.6,PHP5)mb_strwidth返回字符串的宽度说明intmb_strwidth(string$str[,string$encoding=mb_internal_encoding()])返回string类型str的宽度。多字节字符通常是单字

PHP:mb_strtoupper()的用法_mbstring函数 mb_strtoupper(PHP4=4.3.0,PHP5)mb_strtoupper使字符串大写说明stringmb_strtoupper(string$str[,string$encoding=mb_internal_encoding()])将所有的字母字符转化成大写并返回str。参数s

PHP:mb_strtolower()的用法_mbstring函数 mb_strtolower(PHP4=4.3.0,PHP5)mb_strtolower使字符串小写说明stringmb_strtolower(string$str[,string$encoding=mb_internal_encoding()])返回所有字母字符转换成小写的str。参数str要

本文链接地址:https://www.jiuchutong.com/biancheng/275038.html 转载请保留说明!
下一篇链接:https://www.jiuchutong.com/biancheng/275039.html
免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络