function decodeHTML($string) { $string = preg_replace("/\%26/","&",$string); $string = preg_replace("/\%20/"," ",$string); $string = preg_replace("/\%2D/","-",$string); $string = preg_replace("/\%2B/","+",$string); $string = preg_replace("/\%23/","#",$string); $string = preg_replace("/\%27/","'",$string); $string = preg_replace("/\%22/","\"",$string); $strng = addSlashes($string); return $string; } function sanitizeForURL($str) { $url = stripslashes($str); $url = preg_replace("/\&/","%26",$url); $url = preg_replace("/ /","%20",$url); $url = preg_replace("/-/","%2D",$url); $url = preg_replace("/\+/","%2B",$url); $url = preg_replace("/#/","%23",$url); $url = preg_replace("/\'/","%27",$url); $url = preg_replace("/\"/","%22",$url); return $url; } function sanitizeForPost($str) { $url = $str; $url = preg_replace("/\&/","%26",$url); $url = preg_replace("/ /","%20",$url); $url = preg_replace("/-/","%2D",$url); $url = preg_replace("/\+/","%2B",$url); $url = preg_replace("/#/","%23",$url); $url = preg_replace("/\'/","%27",$url); $url = preg_replace("/\"/","%22",$url); return $url; }