php str_word_count() 函数

时间:2016-03-23
php str_word_count() 函数可以方便的将输入的字符串参数中的单词个数返回。
<?php
    $str = "hello world";
    echo str_word_count($str);  //输出 2
?>

在线运行