Count number of words in a text string
Posted On at by milanCount number of words in a text string
Description
This will count through the sentences in a section of text and show how many words are contained within it.
The code
$text = "This is some text.";
$count = count(explode(" ", $text));
echo "$text contains $count words";
?>