3v4l.org

run code in 300+ PHP versions simultaneously
<?php setlocale(LC_ALL, 'en_GB'); $text = "Test êéest"; $text = preg_replace('~[^\\pL\d]+~u', '-', $text); $text = trim($text, '-'); $text = iconv('UTF-8','ASCII//TRANSLIT', $text); $text = strtoupper($text); $text = preg_replace('~[^-\w]+~', '', $text); echo $text;

preferences:
33.41 ms | 402 KiB | 5 Q