A full-featured, simple, clean and pure functional implementation for creating slugs. No third party libraries or extensions needed.
composer require keyvanakbary/slugifier
use slugifier as s;
s\slugify('JúST å fëw wørds'); // just-a-few-words
s\slugify('Αυτή είναι μια δοκιμή'); // ayti-einai-mia-dokimi
s\slugify('Wikipedia style', '_'); // wikipedia_style
Sometimes the default character map is not accurate enough. Slugifier supports custom modifiers
s\slugify('Pingüino', '-', ['ü' => 'u']); // pinguino
Some language iso code modifiers are supported
s\slugify('Estaĵo', '-', s\MOD['eo']); // estajxo
s\slugify('Örnektir', '-', s\MOD['tr']); // ornektir