Add Topic


waiting answer July 28, 2021

How to find number of words in a string

June 13, 2021

The PHP function str_word_count() is used to find the number of words in a string.

Let's check the following example to understand how this function actually works

        $string = 'Welcome to America. Nice to meet you';
        echo str_word_count($string); // Outputs: 7
0 0

Please Login to Post the answer

Leave an Answer