PHPackages                             jaenmedina/slugifier - 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. jaenmedina/slugifier

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

jaenmedina/slugifier
====================

A simple php library to generate slugs.

0.3.0(11y ago)230MITPHPPHP &gt;=5.4.3

Since Apr 9Pushed 11y ago1 watchersCompare

[ Source](https://github.com/jaenmedina/slugifier)[ Packagist](https://packagist.org/packages/jaenmedina/slugifier)[ Docs](http://www.slugifier.com)[ RSS](/packages/jaenmedina-slugifier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Slugifier
=========

[](#slugifier)

[![Build Status](https://camo.githubusercontent.com/5d62564871f12b075843d1a5b9b46446ba67c9c1b1d981ddb7fb219b7cd37af0/68747470733a2f2f7472617669732d63692e6f72672f6a61656e6d6564696e612f736c756769666965722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jaenmedina/slugifier)[![Codacy Badge](https://camo.githubusercontent.com/75104b121f0b36823a00a35cb0d05cff67043dc8d55f234a3df67d20ee7a0eb9/68747470733a2f2f7777772e636f646163792e636f6d2f70726f6a6563742f62616467652f3838326265366136353139313433323761373138376139323132636565376662)](https://www.codacy.com/app/jaen-medina/slugifier)[![Code Climate](https://camo.githubusercontent.com/c11f12ea0da308b10e16e3c9dc2ce7dd84c63caef194a5fecfec4ba5a1b679f3/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6a61656e6d6564696e612f736c756769666965722f6261646765732f6770612e737667)](https://codeclimate.com/github/jaenmedina/slugifier)

A simple php library to generate slugs.

Version
-------

[](#version)

0.3.1

Install with composer
---------------------

[](#install-with-composer)

Add the package dependency jaenmedina/slugifier in your composer.json

```
{
    "require": {
        "jaenmedina/slugifier": "0.3.1"
    }
}
```

How to use?
-----------

[](#how-to-use)

Just instantiate the Slugifier class and call the slugify method. For example:

```
$slugifier = new Slugifier();
$slug = $slugifier->slugify("Hello, world!");
echo $slug; // prints "hello-world"
```

If you want to set the separator just use the setSeparator function:

```
$slugifier = new Slugifier();
$slugifier->setSeparator("_");
$slug = $slugifier->slugify("Hello, world!");
echo $slug; // prints "hello_world"
```

If you want to exclude certain words from the slug you can use the excludeWords function:

```
$slugifier = new Slugifier();
$slugifier->excludeWords(["world", "How", "is"]);
$slug = $slugifier->slugify("Hello, world! How is everybody?");
echo $slug; // prints "hello-everybody"
```

To add specific mapping rules you can use the addRule, addRules and setRules functions:

```
$slugifier = new Slugifier();
$slugifier->setRules(["é" => "e"]);
$slugifier->addRule("ñ", "n");
$slugifier->addRules(["ü" => "u"]);
$slug = $slugifier->slugify("Intenté Español Pingüino");
echo $slug; // prints "intente-espanol-pinguino"
```

License
-------

[](#license)

MIT

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

3

Last Release

4057d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2059d2965e7a2df8c58972e303a281b14bb35d5eeace1ae0f72cb8fc4d070587?d=identicon)[jaenmedina](/maintainers/jaenmedina)

---

Top Contributors

[![jaenmedina](https://avatars.githubusercontent.com/u/10797075?v=4)](https://github.com/jaenmedina "jaenmedina (5 commits)")

---

Tags

phpslugslugifyslugifier

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jaenmedina-slugifier/health.svg)

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

###  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)[keyvanakbary/slugifier

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

68187.9k4](/packages/keyvanakbary-slugifier)

PHPackages © 2026

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