01.统计字符串指定 字符 出现的次数
<?php
$str = “0,51,53,54,”;
$keyword = “,”;
echo “souce string:”.$str.“</br>”;
echo “search keyword repeat times:“.$keyword.“</br>”;
echo “——-Result——“.“</br>”;
echo substr_count($str,“,”) ;
?>
测试结果:
souce string: 0,51,53,54,
search keyword repeat times:,
——-Result——
4