3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "This is çthe, sample ştext.üfor replace the each words in, array"; $str = ucwords(strtolower($str), ',\'. '); function customUpper($s) { $old = array('ş', 'i', 'ğ', 'ü', 'ö', 'ç', 'ı'); $new = array('Ş', 'İ', 'Ğ', 'Ü', 'Ö', 'Ç', 'I'); return str_replace($old, $new, $s); } echo customUpper($str);

preferences:
58.22 ms | 1499 KiB | 5 Q