A PHP library to convert strings into URL-friendly slugs with transliteration for many languages.
cocur/slugify is a robust PHP library that converts any string into a clean, URL-friendly slug. It is designed for web applications that need readable and SEO-friendly URLs from user-generated content, handling special characters from over 30 languages through intelligent transliteration instead of simply removing them.
PHP developers building web applications that require SEO-friendly URL generation from user input, especially those working with multilingual content or popular PHP frameworks like Symfony, Laravel, or Twig.
Developers choose cocur/slugify for its extensive multilingual transliteration support, framework integrations, and flexibility—offering customizable rules and configuration options while maintaining a dependency-free core with only PHP's Multibyte String extension required.
Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles transliteration for over 30 languages like Arabic, Chinese, and Turkish, converting special characters to ASCII approximations instead of stripping them, as detailed in the rulesets.
Provides ready-to-use bridges for Symfony, Laravel, Twig, and others, reducing setup time and ensuring compatibility with popular PHP ecosystems.
Offers flexible options like custom separators, case control, regex patterns, and language-specific rulesets, allowing fine-tuned slug generation per project needs.
Self-contained library requiring only PHP's Multibyte String extension, keeping the codebase lightweight and avoiding composer conflicts.
Relies on PHP's Multibyte String extension, which may not be enabled by default on all servers, adding a setup hurdle and potential deployment issues.
Integrations are tied to specific framework versions (e.g., Symfony 3-5, Twig 2-3), risking incompatibility with future updates or unsupported environments.
Cannot be used for client-side slug generation in JavaScript applications, restricting its utility in modern full-stack or static site setups.