2017 © Pedro Peláez
 

library urlify

urlify - a library for creating url-safe slugs from text

image

oodle/urlify

urlify - a library for creating url-safe slugs from text

  • Saturday, November 30, 2013
  • by mmucklo
  • Repository
  • 2 Watchers
  • 0 Stars
  • 8,302 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Urlify

Urlify is a library for creating url-safe slugs from text. It will also down-convert (Romanize) foreign ascii characters into plain ascii., (*1)

Installation:

Add this line to your composer.json "require" section:, (*2)

composer.json

    "require": {
       ...
       "oodle/urlify": "*"

Usage:

Urlify\Urlify::urlify($string, $separator = '-', $ampersand = null)

Examples:

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)

Notes:

Please note that the string should be in ascii or iso-8859-1 in order for Romanization to work, (*10)

The Versions

30/11 2013

dev-master

9999999-dev

urlify - a library for creating url-safe slugs from text

  Sources   Download

MIT

The Requires

  • php >=5.3.17

 

The Development Requires

by Matthew J. Mucklo

url seo slug slugify urlify urlification