//
// Convert a 'safe' url into words, for display on the page or inserting into a database
//
function purifyURL($url){
$url = trim($url);
$bannedChars = array("'",':','@');
$url = str_replace($bannedChars, '', $url);
$switchedChars = array('-','.','_');
$url = str_replace($switchedChars, ' ', $url);
$url = htmlspecialchars($url, ENT_QUOTES, 'utf-8');
$url = strtolower($url); // all to lowercase
$url = ucwords($url); // capitalise first characters
$url = mysql_real_escape_string($url);
return $url;
}
Main Category