A fast PHP slug generator and transliteration library that converts non-ASCII characters for use in URLs.
URLify is a PHP library for generating URL-friendly slugs and transliterating Unicode text into ASCII. It converts multilingual content into clean, readable ASCII strings, essential for creating SEO-friendly URLs and sanitizing filenames. It started as a port of Django's URLify.js and handles symbols from numerous languages.
PHP developers building multilingual web applications that require clean URL slugs or ASCII transliteration, such as those working on content management systems, e-commerce platforms, or internationalized websites.
Developers choose URLify for its fast, reliable transliteration of many languages into ASCII, its lightweight integration, and features like custom character maps and language-specific rule prioritization, which ensure correctness for diverse character sets.
A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.
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 including Arabic, Cyrillic, Turkish, and Vietnamese as listed in the README, ensuring clean URLs for international websites without extensive custom code.
Allows extending or overriding transliteration rules via `add_chars()`, enabling support for specialized symbols or domains, as shown in the README with examples like '¿' to '?'.
Supports specifying languages like 'de' or 'tr' to apply correct transliteration rules, demonstrated in the README where 'ü' is handled differently for German vs. Turkish, improving accuracy for localized content.
Includes a filter method to sanitize file names to safe ASCII characters while preserving extensions, useful for handling uploads in multilingual applications, as evidenced by the `URLify::filter` example with 'фото.jpg'.
For many languages, it relies on `ASCII::to_transliterate()` which may not provide accurate transliteration for all scripts, as admitted in the README, requiring additional work or custom mapping for full coverage.
Adding custom characters or removing words requires manual code updates via `add_chars()` or `remove_words()`, which can be tedious and error-prone for large or dynamic character sets, lacking a built-in management system.
While described as fast, the transliteration process involves complex character mapping and dependency on external ASCII methods, which might not scale efficiently for real-time, high-volume slug generation compared to simpler alternatives.