- substr: documentation ( source)
- strpos: documentation ( source)
- substr_replace: documentation ( source)
<?php
$string = 'This is a string of words with multiple vowels.';
function asdf($string){
for ($i=strlen($string); $i >= 0 ; $i--) {
if (strpos("aeiouAEIOU", substr($string, $i, 1)) !== false) {
return substr_replace($string, "", $i, 1);
}
}
return $string;
}
echo asdf($string);