Menu

Add Topic

programming

waiting answer July 28, 2021

How to find number of words in a string

Answers
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

     <?php
        $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