Program to count vowels in a string ( Iterative and Recursive ) | Function to check the Vowel ; Returns count of vowels in str ; if ( isVowel ( $str [ $i ] ) ) Check for vowel ; string object ; Total numbers of Vowel
< ? php function isVowel ( $ ch ) { $ ch = strtoupper ( $ ch ) ; return ( $ ch == ' A ' $ ch == ' E ' $ ch == ' I ' $ ch == ' O ' $ ch == ' U ' ) ; } function countVowels ( $ str ) { $ count = 0 ; for ( $ i = 0 ; $ i < strlen ( $ str ) ; $ i ++ ) ++ $ count ; return $ count ; } $ str = " abc ▁ de " ; echo countVowels ( $ str ) . " STRNEWLINE " ; ? >