/ Published in: PHP
This filters a string into a "friendly" string for use in URL's. It converts the string to lower case and replaces any non-alphanumeric (and accented) characters with dashes. 2 alternatives available.
Expand |
Embed | Plain Text
function slug($str) { return $str; } function slugify($str, $replace="-") { // replace all non letters or digits by $replace // trim and lowercase return $str; }
Comments
Subscribe to comments
You need to login to post a comment.

looks similar to mine: http://snipplr.com/view/43418/slugify-function-clean-urls/ :)