PHPize Online / SQLize Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy
Copy Format Clear
<?php function reverse_vowels($word) { preg_match_all('/[ayeiou]/i', $word, $matches); $vowels = $matches[0]; foreach(str_split($word) as $i=>$c) { if (in_array($c, $matches[0])) { $word[$i] = array_pop($vowels); } } return $word; } echo reverse_vowels('kapez');
Show:  
Copy