/ 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
Copy this code and paste it in your HTML
/** * Modifies a string to remove al non ASCII characters and spaces. */ static public function slugify($text) { // replace non letter or digits by - // trim // transliterate { } // lowercase // remove unwanted characters { return 'n-a'; } return $text; }
Comments
