Skip to content

Instantly share code, notes, and snippets.

View maolivn's full-sized avatar

Tan Phan maolivn

  • Can Tho, Vietnam
View GitHub Profile
@maolivn
maolivn / url_slug.php
Last active August 29, 2015 14:25 — forked from sgmurphy/url_slug.php
URL Slugs in PHP (with UTF-8 and Transliteration Support)
<?php
/**
* Create a web friendly URL slug from a string.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.