Check if the current character of the string is a vowel and both the previous and the next characters are consonants , if so then this is a sandwiched vowel , thus is ignored and not appended to the updated string
if ( isVowel ( $ a [ $ i ] ) && ! isVowel ( $ a [ $ i - 1 ] ) && ! isVowel ( $ a [ $ i + 1 ] ) ) { continue ; }