Answer the question
In order to leave comments, you need to log in
How to use php to remove the last letter in a word, if only it is a vowel?
How to do it in the best and fastest way, and not just brute force.
Answer the question
In order to leave comments, you need to log in
$str = "hello";
$vowels = ['a', 'e', 'i', 'o', 'u', 'y'];
if (in_array(substr($str) - 1), $vowels) {
echo 'Гласная';
} else {
echo 'Согласная';
}
And how, apart from sorting through the letters, can you understand that it is a consonant?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question