如何判断一个字串里面有两个 "Yes"字符的

soktest 2005-11-10 01:20:16
如题,请多指教!谢谢
...全文
98 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
metasos 2005-11-10
  • 打赏
  • 举报
回复
汗, 竟然没发现过这个函数, 挺不错的
颓废的老猫 2005-11-10
  • 打赏
  • 举报
回复
int substr_count ( string haystack, string needle)


substr_count() returns the number of times the needle substring occurs in the haystack string. Please note that needle is case sensitive.

例子 1. substr_count() example

<?php
echo substr_count("This is a test", "is"); // prints out 2
?>



See also count_chars(), strpos(), substr(), and strstr().

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧