Remove consecutive vowels from string | function which returns True or False for occurrence of a vowel ; this compares vowel with character ' c ' ; function to print resultant string ; print 1 st character ; loop to check for each character ; comparison of consecutive characters ; Driver code
< ? php function is_vow ( $ c ) { return ( $ c == ' a ' ) || ( $ c == ' e ' ) || ( $ c == ' i ' ) || ( $ c == ' o ' ) || ( $ c == ' u ' ) ; } function removeVowels ( $ str ) { printf ( $ str [ 0 ] ) ; for ( $ i = 1 ; $ i < strlen ( $ str ) ; $ i ++ ) if ( ( ! is_vow ( $ str [ $ i - 1 ] ) ) || ( ! is_vow ( $ str [ $ i ] ) ) ) printf ( $ str [ $ i ] ) ; } $ str = " ▁ geeks ▁ for ▁ geeks " ; removeVowels ( $ str ) ; ? >