- trim: documentation ( source)
- strtoupper: documentation ( source)
- preg_replace: documentation ( source)
- setlocale: documentation ( source)
- iconv: documentation ( source)
<?php
setlocale(LC_ALL, 'fr_FR');
$text = "Test êéest";
$text = preg_replace('~[^\\pL\d]+~u', '-', $text);
$text = trim($text, '-');
$text = iconv('UTF-8','ASCII//TRANSLIT', $text);
$text = strtoupper($text);
echo $text;