/ Published in: PHP
Function which will slugify a string for use in URLs, taking out any spaces and other non-URL useful characters.
Expand |
Embed | Plain Text
/** * Modifies a string to remove al non ASCII characters and spaces. */ { // replace non letter or digits by - // trim // transliterate { } // lowercase // remove unwanted characters { return 'n-a'; } return $text; }
Comments
Subscribe to comments
You need to login to post a comment.

For those not knowing to what 'slug' refers read this: http://codex.wordpress.org/Glossary#Slug