3v4l.org

run code in 300+ PHP versions simultaneously
<?php function slugify(string $input): string { $translitRules = [ ":: Any-Latin", ":: [:Nonspacing Mark:] Remove", ":: [:Punctuation:] Remove", ":: [:Symbol:] Remove", ":: Latin-ASCII", ":: Lower()", "' ' {' '} > ", "::NULL", "[:Separator:] > '-'", ]; $transliterator = \Transliterator::createFromRules( implode(';', $translitRules) ); return $transliterator->transliterate($input); } $title = '<?php François😎: _+ / Стравинский`😜.'; $slug = slugify($title); var_dump($slug);

preferences:
33.49 ms | 406 KiB | 5 Q