strtoslug() – SEO Friendly URL’s with PHP
October 8, 2009 at 4:52 pm | PHP | No comment
Quick n’ Simple. Check it:
function strtoslug($str) {
$str = strtolower(trim($str));
$str = preg_replace('/[^a-z0-9-]/', '-', $str);
$str = preg_replace('/-+/', "-", $str);
return $str;
}
