This function is a very simple check of the URL to see if it appears to have the correct form. We will use this function prior to attempting to connect to any URL.
<?php function _checkURL($url) { return preg_match ("/http:\/\/(.*)\.(.*)/i", $url); } ?>