Search code examples
phpslugseparatorslugify

Completely remove separators using slugify


I am using slugify to generate the users slug but I want to remove dashes, dots, spaces and every type character that would be considered a separator.


Solution

  • This is possible changing the default separator to an empty string, so this:

    echo $slugify->slugify('A strange.example_user-name', '');
    

    Will return this:

    astrangeexampleusername