SLUG

Create SEO-friendly URL titles

function slug($str)
{
	$str = utf8_encode(html_entity_decode($str));
	$str = str_replace('&', 'e', trim(strip_tags($str)));
	$str = preg_replace('/&([A-Za-z]{1,2})(grave|acute|circ|cedil|uml|lig|tilde);/', '$1', htmlentities($str, ENT_NOQUOTES, 'UTF-8'));
	$str = preg_replace(array('([\40])', '([^a-zA-Z0-9-])', '(-{2,})'), array('-', '', '-'), $str);
	$str = str_replace('-acute', '', trim($str));
    	return strtolower($str);
}

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>