public static function validateURL($url = null)
    {
        $url = trim($url);

        if (is_null($url) || $url == '') {
            return $url;
        }

        if (!preg_match('#^http[s]?:\/\/#i', $url)) {
            $url = 'http://' . $url;
        }

        include TOOLKIT . '/util.validators.php';

        if (!preg_match($validators['URI'], $url)) {
            $url = '';
        }

        return $url;
    }
public static function validateURL($url = null)
    {
        $url = trim($url);

        if (is_null($url) || $url == '') {
            return $url;
        }

        if (!preg_match('#^http[s]?:\/\/#i', $url)) {
            $url = 'http://' . $url;
        }

        include TOOLKIT . '/util.validators.php';

        if (!preg_match($validators['URI'], $url)) {
            $url = '';
        }

        return $url;
    }
public static function validateURL ( $ url = null ) { $ url = trim ( $ url ) ; if ( is_null ( $ url ) || $ url == '' ) { return $ url ; } if ( ! preg_match ( '#^http[s]?:\/\/#i' , $ url ) ) { $ url = 'http://' . $ url ; } include TOOLKIT . '/util.validators.php' ; if ( ! preg_match ( $ validators [ 'URI' ] , $ url ) ) { $ url = '' ; } return $ url ; }
Check that a string is a valid URL.

@param string $url
string to operate on
@return string
a blank string or a valid URL
Check that a string is a valid URL .