Anonymous
public text v1 · immutablefunction beginsWithVowel($str) {
$vowels[0] = 'a';
$vowels[1] = 'e';
$vowels[2] = 'i';
$vowels[3] = 'o';
$vowels[4] = 'u';
$str2 = strtolower($str);
if($vowels[array_search($str2{0}, $vowels)] == $str2{0} ) {
return "an";
} else {
return "a";
}
}