Skip to content

rogerthomas84/php-slugify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slugify

Generate a URL safe slugs from strings...

Usage:

composer require rogerthomas84/slugify

Convert a string to a slug:

<?php
$string = 'The quick brown fox jumped over the lazy dog.';
$slug = \Slugify\Slugify::get($string);
// $slug = string(44) "the-quick-brown-fox-jumped-over-the-lazy-dog"

// Slugify also removes any special (non alphanumeric) characters...

$string2 = 'The "quick" brown fox jumped (OVER) the lazy dog!';
$slug2 = \Slugify\Slugify::get($string2);
// $slug2 = string(44) "the-quick-brown-fox-jumped-over-the-lazy-dog"

About

Generate a URL safe slugs from strings

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages