I am trying to get the number of vowels in the string how can I make this work? I always get one more that I should.
If I type:PHP Code:$numvow = 0 ;
$delims = "'a''e''i''o''u'";
$vows = strtok ($str, $delims);
while (is_string ($vows)){
if ($vows)
$numvow = $numvow + 1;
$vows = strtok ($delims);
}
$msg = "The number of vowels in your paragraph(s) are: $numvow. <br>(Please use Back Button for more testing...)";
break;
I get:Code:This is a test. This is a test.
Can anyone help me with this?Code:The number of sentences in your paragraph(s) are: 9. (Please use Back Button for more testing...)





Bookmarks