GM.*_*GM. 1 php
我在PHP中搜索一个函数来返回字符串中字符的出现次数.
输入那些参数"hello world",'o'将返回2
Rag*_*geZ 8
substr_count 是你的朋友
substr_count
var_dump( substr_count("hello world", 'o') );
注意:这也可以substr_count搜索子字符串
var_dump( substr_count("hello world", 'hello') );
归档时间:
16 年,3 月 前
查看次数:
261 次
最近记录:
13 年,10 月 前