![]() |
It will count number of Words from a String. |
Example:
PHP
<?php
// PHP program to count number of
// words in a string
$str = "I Love US";
// Using str_word_count() function to
// count number of words in a string
$len = str_word_count($str);
// Printing the result
echo $len;
?>
php count |
How to count Words in PHP | PHP String Tutorial |
Read Full: | PHP String Tutorial |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | PHP String Tutorial |
Uploaded by: | Admin |
Views: | 103 |
Tested on: | PHP 7 |
Reffered: https://www.geeksforgeeks.org/how-to-count-the-number-of-words-in-a-string-in-php/