dev-master
9999999-devurlify - a library for creating url-safe slugs from text
MIT
The Requires
- php >=5.3.17
The Development Requires
by Matthew J. Mucklo
url seo slug slugify urlify urlification
urlify - a library for creating url-safe slugs from text
Urlify is a library for creating url-safe slugs from text. It will also down-convert (Romanize) foreign ascii characters into plain ascii., (*1)
Add this line to your composer.json "require" section:, (*2)
"require": { ... "oodle/urlify": "*"
Urlify\Urlify::urlify($string, $separator = '-', $ampersand = null)
use Urlify\Urlify;, (*3)
echo Urlify::urlify('blah blah blah'); // Should output "blah-blah-blah", (*4)
echo Urlify::urlify('This is a sentence.'); // Should output "This-is-a-sentence", (*5)
echo Urlify::urlify('kraüt'); // Should output "kraut", (*6)
echo Urlify::urlify('what ever', '.'); // Should output "what.ever", (*7)
echo Urlify::urlify('blah&blah'); // Should output "blah-blah", (*8)
echo Urlify::urlify('blah&blah', '-', 'and'); // Should output "blah-and-blah" ```, (*9)
Please note that the string should be in ascii or iso-8859-1 in order for Romanization to work, (*10)
urlify - a library for creating url-safe slugs from text
MIT
url seo slug slugify urlify urlification