I want to count the number of words in a string with more than six letters.
For example:
$x = number of words with more than 6 letters("Elephant shoe penguin food telephone");
$x=3;
Do you know how?
I want to count the number of words in a string with more than six letters.
For example:
$x = number of words with more than 6 letters("Elephant shoe penguin food telephone");
$x=3;
Do you know how?
Use regexp:
$x = preg_match_all("/\\w{6,}/", "Elephant shoe penguin food telephone", $matches);