PHP str_word_count() string function

The str_word_count() function in PHP

The php str_word_count() sting function is used to count a number of words in a string.

str_word_count() function syntax

str_word_count(“string”);

PHP str_word_count() function example

In above example there are three words in a given string the “Hello”, “Meera” and “Academy”.

The output is:

The number of words in a string = 3

PHP str_word_count() example with php form

The out put is :

PHP str_word_count() string function

PHP str_word_count() string function

Leave a Reply

Your email address will not be published. Required fields are marked *

5 + 9 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">