PHP string str_word_count() FunctionThe str_word_count() is in-built function of PHP. It is used to return information about words used in a string or counts the number of words in a string. Syntax:
Example 1Output: Your string is:PHP Javatpoint By using str_word_count(): 2 Example 2Output: Your string is:PHP Javatpoint Array ( [0] => PHP [1] => Javatpoint ) Example 3Output: Array ( [0] => Hello [1] => PHP [2] => Javatpoint ) Array ( [0] => Hello [1] => PHP [2] => & [3] => Javatpoint ) Reference: http://php.net/manual/en/function.str-word-count.php
Next TopicPHP String
|