function fn_hw_generate_seoname( $string, $separator = '-' ){
//Unwanted: {UPPERCASE} ; / ? : @ & = + $ , . ! ~ * ' ( )
$string = strtolower($string);
//Strip any unwanted characters
$string = preg_replace("/[^a-z0-9_\s-]/", "", $string);
//Clean multiple dashes or whitespaces
$string = preg_replace("/[\s-]+/", " ", $string);
//Convert whitespaces and underscore to dash
$string = preg_replace("/[\s_]/", "-", $string);
return $string;
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.