PHP Mixed Str_Word_Count ( String Str [, Int Count_Type [, String Char_List]] ) Returns Number Of Words In String – String Function

<?
    $str = "This is a test, only a test, and nothing but a test.";
    $a = str_word_count($str, 1);
    $b = str_word_count($str, 2);
    $c = str_word_count($str);
    print_r($a);
    print_r($b);
    echo "There are $c words in the string\n";
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.