3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace_old_chrs_utf8($str) { $vd = strtoupper('ð'); $old = array('æ', 'Æ', 'è', 'È', 'ð', $vd); $new = array('ć', 'Ć', 'č', 'Č', 'đ', 'Đ'); $fin = str_replace($old, $new, $str); return $fin; } $testString = 'æ-Æ bananna è moose Èð'; var_dump(replace_old_chrs_utf8($testString));

preferences:
32.7 ms | 402 KiB | 5 Q