=200 && $httpcode<400 ) return true; else return false; } function sanitizeUrl($url){ if ( ! preg_match("|^[a-zA-Z]+://|", $url) ) $url = "http://" . $url; if ( preg_match("|^[a-zA-Z]+://.+\.[a-zA-Z]+(?/.*)|", $url, $match) ) $url = str_replace($match["query"], "", $url); return $url; }