Php Transliterator
<?php function slugify($string) { $translit = "Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();"; $string = transliterator_transliterate($translit, $string); $string = preg_replace('/[-\s]+/', '-', $string); return trim($string, '-'); } echo slugify("Я люблю PHP!");
23 января 2021, 21:09