3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = 'Äßmeier_von_Ümlauts_aÌ.jpg'; function replaceUmlauts(string $string): string { $umlauts = [ 'Ä' => 'Ae', 'ä' => 'ae', 'Ö' => 'Oe', 'ö' => 'oe', 'Ü' => 'Ue', 'ü' => 'ue', 'ß' => 'ss', ]; foreach ($umlauts as $umlaut => $replacement) { $string = str_replace($umlaut, $replacement, $string); } return $string; } $normalized = Normalizer::normalize($string, Normalizer::FORM_KD); var_dump($normalized); var_dump(Normalizer::isNormalized($normalized, Normalizer::FORM_KD)); $normalized2 = Normalizer::getRawDecomposition($string); var_dump($normalized2); var_dump(iconv("UTF-8", "ASCII//TRANSLIT", $normalized));
Output for 7.3.0rc3
string(33) "Äßmeier_von_Ümlauts_aÌ.jpg" bool(true) NULL string(30) "A?ssmeier_von_U?mlauts_aI?.jpg"