php统计字符串单词数量
<?php function word_count($sentence){ $array = explode(" ", $sentence); return count($array); } $words = word_count("The is a group of words"); echo $words; ?>
php统计字符串单词数量
<?php function word_count($sentence){ $array = explode(" ", $sentence); return count($array); } $words = word_count("The is a group of words"); echo $words; ?>