- array_unshift: documentation ( source)
- implode: documentation ( source)
- stripos: documentation ( source)
- array_pop: documentation ( source)
- str_split: documentation ( source)
<?php
$string = 'This is a string of words with multiple vowels.';
$old = str_split($string);
$new = array();
while ($old) {
$chr = array_pop($old);
if (stripos("aeiou", $chr) !== false) {
break;
}
array_unshift($new, $chr);
}
echo implode("", $old) . implode("", $new);