PHPackages                             voku/urlify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. voku/urlify

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

voku/urlify
===========

PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.

5.0.7(4y ago)254.1M—6.8%5[2 PRs](https://github.com/voku/urlify/pulls)7BSD-3-ClausePHPPHP &gt;=7.0.0

Since Feb 11Pushed 1y ago3 watchersCompare

[ Source](https://github.com/voku/urlify)[ Packagist](https://packagist.org/packages/voku/urlify)[ Docs](https://github.com/voku/urlify)[ Fund](https://www.paypal.me/moelleken)[ GitHub Sponsors](https://github.com/voku)[ RSS](/packages/voku-urlify/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (63)Used By (7)

[![Build Status](https://camo.githubusercontent.com/578a86243870db57b4da41b64ada0a037ef0ce3ec62d97e474e5b17743614bfd/68747470733a2f2f7472617669732d63692e6f72672f766f6b752f75726c6966792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/voku/urlify)[![Coverage Status](https://camo.githubusercontent.com/3cf0e9423a6f10708cbb009c7e22d7b7951d7d8ecf0477a31c0b8f750a094f1e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f766f6b752f75726c6966792f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/voku/urlify?branch=master)[![Codacy Badge](https://camo.githubusercontent.com/b49bb0d9c6235fdc00b6f2461251e616a3f4e61bdef868ea9ddbcb9f9046377f/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3939303464353936623835313438393161333863623362353639636434643935)](https://www.codacy.com/app/voku/urlify)[![Latest Stable Version](https://camo.githubusercontent.com/c9cbc24b407b8c3911d8984e6350fb0f46a05775c86267ea91b82af52aae784f/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f75726c6966792f762f737461626c65)](https://packagist.org/packages/voku/urlify)[![Total Downloads](https://camo.githubusercontent.com/92e9f14a51293d53a1a3990122175a4a78f3f15791a216c7f38b12ce4e1809e8/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f75726c6966792f646f776e6c6f616473)](https://packagist.org/packages/voku/urlify)[![License](https://camo.githubusercontent.com/e23877ad906d34e497000deb0fc5ba31ee18e631c3004d7cc0c27a3bdecbde12/68747470733a2f2f706f7365722e707567782e6f72672f766f6b752f75726c6966792f6c6963656e7365)](https://packagist.org/packages/voku/urlify)[![Donate to this project using Paypal](https://camo.githubusercontent.com/0d6e4d8b50b5983a58205941b1a581b1305903393b7a39da574e3f60af3c7f5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617970616c2d646f6e6174652d79656c6c6f772e737667)](https://www.paypal.me/moelleken)[![Donate to this project using Patreon](https://camo.githubusercontent.com/f9e075baad95563481d35174d43ef50757281abb6bc795d0f473fad452afa030/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d646f6e6174652d79656c6c6f772e737667)](https://www.patreon.com/voku)

🔗 URLify
========

[](#-urlify)

Description
-----------

[](#description)

Convert any string into an valid and readable string for usage in the url.

This is a PHP port of "URLify.js" from the Django project + fallback via "Portable ASCII". We handles symbols from many languages via an matching-array and others via "ASCII::to\_transliterate()".

-
-
-

Install via "composer require"
------------------------------

[](#install-via-composer-require)

```
composer require voku/urlify
```

Usage:
------

[](#usage)

namespace: "voku\\helper\\URLify"

#### To generate slugs for URLs:

[](#to-generate-slugs-for-urls)

```
echo URLify::filter(' J\'étudie le français ');
// "J-etudie-le-francais"

echo URLify::filter('Lo siento, no hablo español.');
// "Lo-siento-no-hablo-espanol"
```

#### To generate slugs for file names:

[](#to-generate-slugs-for-file-names)

```
echo URLify::filter('фото.jpg', 60, '', true);
// "foto.jpg"
```

#### To simply transliterate characters:

[](#to-simply-transliterate-characters)

```
echo URLify::downcode('J\'étudie le français');
// "J'etudie le francais"

echo URLify::downcode('Lo siento, no hablo español.');
// "Lo siento, no hablo espanol."

/* Or use transliterate() alias: */

echo URLify::transliterate('Lo siento, no hablo español.');
// "Lo siento, no hablo espanol."
```

#### To extend the character list:

[](#to-extend-the-character-list)

```
URLify::add_chars(array(
  '¿' => '?', '®' => '(r)', '¼' => '1/4',
  '½' => '1/2', '¾' => '3/4', '¶' => 'P'
));

echo URLify::downcode('¿ ® ½ ¼ ¾ ¶');
// "? (r) 1/2 1/4 3/4 P"
```

#### To extend or replace the default replacing list:

[](#to-extend-or-replace-the-default-replacing-list)

```
URLify::add_array_to_seperator(array(
  "/®/"
));

echo URLify::filter('¿ ® ½ ¼ ¾ ¶');
// "12-14-34-P"
```

#### To extend the list of words to remove for one language:

[](#to-extend-the-list-of-words-to-remove-for-one-language)

```
URLify::remove_words(array('remove', 'these', 'too'), 'de');
```

#### To prioritize a certain language map:

[](#to-prioritize-a-certain-language-map)

```
echo URLify::filter(' Ägypten und Österreich besitzen wie üblich ein Übermaß an ähnlich öligen Attachés ', 60, 'de');
// "Aegypten-und-Oesterreich-besitzen-wie-ueblich-ein-Uebermass-aehnlich-oeligen-Attaches"

echo URLify::filter('Cağaloğlu, çalıştığı, müjde, lazım, mahkûm', 60, 'tr');
// "Cagaloglu-calistigi-mujde-lazim-mahkum"
```

Please note that the "ü" is transliterated to "ue" in the first case, whereas it results in a simple "u" in the latter.

Available languages
-------------------

[](#available-languages)

- Arabic: 'ar'
- Austrian (German): 'de\_at'
- Austrian (French): 'fr\_at'
- Azerbaijani: 'az'
- Bulgarian: 'bg'
- Burmese: 'by'
- Croatian: 'hr'
- Czech: 'cs'
- Danish: 'da'
- English: 'en'
- Esperanto: 'eo'
- Estonian: 'et'
- Finnish: 'fi'
- French: 'fr'
- Georgian: 'ka'
- German: 'de'
- Greek: 'el'
- Hindi: 'hi'
- Hungarian: 'hu'
- Kazakh: 'kk'
- Latvian: 'lv'
- Lithuanian: 'lt'
- Norwegian: 'no'
- Polish: 'pl'
- Romanian: 'ro'
- Russian: 'ru'
- Serbian: 'sr'
- Slovak: 'sk'
- Swedish: 'sv'
- Switzerland (German): 'de\_ch'
- Switzerland (French): 'fr\_ch'
- Turkish: 'tr'
- Ukrainian: 'uk'
- Vietnamese: 'vn'

Support
-------

[](#support)

For support and donations please visit [Github](https://github.com/voku/urlify/) | [Issues](https://github.com/voku/urlify/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku).

For status updates and release announcements please visit [Releases](https://github.com/voku/urlify/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts).

For professional support please contact [me](https://about.me/voku).

Thanks
------

[](#thanks)

- Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
- Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
- Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there!
- Thanks to [StyleCI](https://styleci.io/) for the simple but powerfull code style check.
- Thanks to [PHPStan](https://github.com/phpstan/phpstan) &amp;&amp; [Psalm](https://github.com/vimeo/psalm) for relly great Static analysis tools and for discover bugs in the code!

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 74.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~56 days

Recently: every ~193 days

Total

59

Last Release

1575d ago

Major Versions

2.3.1 → 3.0.02017-12-01

3.0.0 → 4.0.02017-12-23

1.1.2-stable → 4.1.02019-01-12

1.1.3-stable → 4.1.12019-09-03

4.1.1 → 5.0.02019-09-07

PHP version history (3 changes)1.0.0-stablePHP &gt;=5.3.0

1.0.2-stablePHP &gt;=5.3

3.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6456fe693db197c458272cb758bf78958bc7d3e787ccd59db4bf3cf41654316a?d=identicon)[voku](/maintainers/voku)

---

Top Contributors

[![voku](https://avatars.githubusercontent.com/u/264695?v=4)](https://github.com/voku "voku (128 commits)")[![jbroadway](https://avatars.githubusercontent.com/u/87886?v=4)](https://github.com/jbroadway "jbroadway (26 commits)")[![nickl-](https://avatars.githubusercontent.com/u/1404606?v=4)](https://github.com/nickl- "nickl- (4 commits)")[![patrickheck](https://avatars.githubusercontent.com/u/778565?v=4)](https://github.com/patrickheck "patrickheck (3 commits)")[![KorvinSzanto](https://avatars.githubusercontent.com/u/1007419?v=4)](https://github.com/KorvinSzanto "KorvinSzanto (2 commits)")[![bamse16](https://avatars.githubusercontent.com/u/147856?v=4)](https://github.com/bamse16 "bamse16 (2 commits)")[![nikmarchenko](https://avatars.githubusercontent.com/u/1553818?v=4)](https://github.com/nikmarchenko "nikmarchenko (2 commits)")[![hkdobrev](https://avatars.githubusercontent.com/u/506129?v=4)](https://github.com/hkdobrev "hkdobrev (1 commits)")[![mlocati](https://avatars.githubusercontent.com/u/928116?v=4)](https://github.com/mlocati "mlocati (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")[![tobiassjosten](https://avatars.githubusercontent.com/u/65159?v=4)](https://github.com/tobiassjosten "tobiassjosten (1 commits)")[![andgrankin](https://avatars.githubusercontent.com/u/1209271?v=4)](https://github.com/andgrankin "andgrankin (1 commits)")

---

Tags

hacktoberfestslugslugifytranslittransliteratetransliterationurlifyurlsluglinkiconvencodeurlifytransliteratetranslittransliteration

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/voku-urlify/health.svg)

```
[![Health](https://phpackages.com/badges/voku-urlify/health.svg)](https://phpackages.com/packages/voku-urlify)
```

###  Alternatives

[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6737.4M62](/packages/jbroadway-urlify)[ausi/slug-generator

Slug Generator

8002.2M22](/packages/ausi-slug-generator)[misd/linkify

Converts URLs and email addresses in text into HTML links

1122.9M10](/packages/misd-linkify)[shivella/laravel-bitly

Laravel package for generating bitly url

75789.0k1](/packages/shivella-laravel-bitly)[keyvanakbary/slugifier

A full-featured, simple, clean and pure functional implementation for creating slugs

68187.9k4](/packages/keyvanakbary-slugifier)[wazum/sluggi

TYPO3 extension for URL slug management with inline editing, auto-sync, locking, access control, and redirects

39488.5k](/packages/wazum-sluggi)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
