Count the pairs of vowels in the given string | Function that return true if character ch is a vowel ; Function to return the count of adjacent vowel pairs in the given string ; If current character and the character after it are both vowels ; Driver code
< ? php function isVowel ( $ ch ) { if ( $ ch == ' a ' $ ch == ' e ' $ ch == ' i ' $ ch == ' o ' $ ch == ' u ' ) return true ; return false ; } function vowelPairs ( $ s , $ n ) { $ cnt = 0 ; for ( $ i = 0 ; $ i < $ n - 1 ; $ i ++ ) { if ( isVowel ( $ s [ $ i ] ) && isVowel ( $ s [ $ i + 1 ] ) ) $ cnt ++ ; } return $ cnt ; } $ s = " abaebio " ; $ n = strlen ( $ s ) ; echo vowelPairs ( $ s , $ n ) ; ? >