Return to Snippet

Revision: 8361
at September 16, 2008 18:19 by section31


Initial Code
function get_clean_url_string($str) {
	$search = array(
		'/\s+/i',
		'/(-|_)(-|_)*/',
		'/[^a-z0-9_-]/i'
	);
	$replace = array(
		'-',
		'$1',
		''
	);
  return preg_replace($search, $replace, trim($str));
}

Initial URL

                                

Initial Description

                                

Initial Title
Clean URL String

Initial Tags

                                

Initial Language
PHP