Program to count vowels in a string ( Iterative and Recursive ) | Function to check the Vowel ; to count total number of vowel from 0 to n ; 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 countVovels ( $ str , $ n ) { if ( $ n == 1 ) return isVowel ( $ str [ $ n - 1 ] ) ; return countVovels ( $ str , $ n - 1 ) + isVowel ( $ str [ $ n - 1 ] ) ; } $ str = " abc ▁ de " ; echo countVovels ( $ str , strlen ( $ str ) ) . " " ; ? >