substr_count() 函数计算子串在字符串中出现的次数。
substr_count(string,substring,start,length)
<?php echo substr_count("Hello world. The world is nice","world"); ?>
substr_count("Hello world. The world is nice","world")
输出:
2