Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2021-04-27 (4 months ago) | | Not enough user ratings | | Total: 99 | | All time: 9,519 This week: 200 |
|
Description | | Author |
This class can be used to create a slug text from a given text string.
It can take a given string encoded in UTF-8 and then can replace non-ASCII characters by equivalent strings that only use ASCII text.
The class uses an internal array that is used to defined how the characters are mapped. It also provides a function that can be used to change the mappings of specific characters. Innovation Award
April 2021
Number 6 |
A slug is a text that is often used in URLs to make them more readable for the users.
Usually this is done by replacing any non-ASCII characters by equivalent characters that can be read by users in the way the characters should sound.
There are many solutions to create a slug text. This package provides a more flexible solution that allows developers to customize how each character is mapped to other characters in the slug text.
This solution may be better when applications need to create slug texts that need to be readable by users that only understand other languages besides English.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 17x |
|
Details
<p align="center"><a href="https://pharaonic.io" target="_blank"><img src="https://raw.githubusercontent.com/Pharaonic/logos/main/php/slugify.jpg" width="470"></a></p>
<p align="center">
<a href="https://github.com/Pharaonic/php-slugify" target="_blank"><img src="http://img.shields.io/badge/source-pharaonic/php--slugify-blue.svg?style=flat-square" alt="Source"></a> <a href="https://packagist.org/packages/pharaonic/php-slugify" target="_blank"><img src="https://img.shields.io/packagist/v/pharaonic/php-slugify?style=flat-square" alt="Packagist Version"></a>
<img src="https://img.shields.io/packagist/dt/pharaonic/php-slugify?style=flat-square" alt="Packagist Downloads"> <img src="http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square" alt="Source">
</p>
<h1 align="center">Simplest Slugify for PHP.</h1>
Install
Slugify requires the Multibyte String mbstring
extension from PHP.<br>
Install the latest version using Composer:
$ composer require pharaonic/php-slugify
Usage
<a name="GS"></a>
Get Slug
use Pharaonic\Slugify\Slugify;
echo Slugify::get('Moamen Eltouny');
// OR
echo slug('Moamen Eltouny');
<a name="RM"></a>
Rules Manipulation
use Pharaonic\Slugify\Slugify;
Slugify::rule('ö', 'oe');
License
MIT license
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.