substr_count 是你的朋友
var_dump( substr_count("hello world", 'o') );
Run Code Online (Sandbox Code Playgroud)
注意:这也可以substr_count搜索子字符串
var_dump( substr_count("hello world", 'hello') );
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
261 次 |
| 最近记录: |