PHP Classes

PHP Slug Generator: Create a slug text for a URL from another text

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 230 All time: 8,107 This week: 200Up
Version License PHP version Categories
php-slugit 0.5MIT/X Consortium ...5PHP 5, Text processing, SEO
Description Author

This class can create a slug text for a URL from another text.

It takes a given text string and processes it to generate a slug text only with plain ASCII text characters that can be used in URLs that are readable and friendly for the users.

The class replaces all spaces by dashes, and transliterate letters with accents and cedillas to the corresponding characters in ASCII.

Picture of afshin akhgar
  Performance   Level  
Name: afshin akhgar <contact>
Classes: 3 packages by
Country: Iran Iran
Age: 37
All time rank: 256444 in Iran Iran
Week rank: 177 Up3 in Iran Iran Up
Innovation award
Innovation award
Nominee: 1x



create url slug from a text and replace special character


composer install
Direct install from composer
composer require afshinpersian/phpslugger

Include it via Composer Autoloader

require __DIR__ . '/vendor/autoload.php';
use PhpSlugger\PhpSlugger;

$phpSlugger = new PhpSlugger();
echo $phpSlugger->slugit('? ? $  ?  I am A web Developer'); // delta-euro-dollor-l-i-am-a-web-developer


  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file PhpSlugger.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,107
This week:200Up
For more information send a message to info at phpclasses dot org.