- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
function cleanUrl( $url ){
$new_url = str_replace( " ", "-", $url );
$new_url = str_replace( "/", "-", $new_url );
$new_url = str_replace( "--", "-", $new_url );
$new_url = str_split( $new_url );
$new_url = preg_grep( "<[A-Za-z0-9-_]+>", $new_url );
$new_url = trim( implode( $new_url ) );
$new_url = strtolower($new_url);
// Was still getting cases of double hyphens
$new_url = str_replace( "--", "-", $new_url );
return $new_url;
}// end function - cleanUrl