yii\authclient\OpenId::hostExists PHP Method

hostExists() public method

Checks if the server specified in the url exists.
public hostExists ( string $url ) : boolean
$url string URL to check
return boolean true, if the server exists; false otherwise
    public function hostExists($url)
    {
        if (strpos($url, '/') === false) {
            $server = $url;
        } else {
            $server = @parse_url($url, PHP_URL_HOST);
        }
        if (!$server) {
            return false;
        }
        $ips = gethostbynamel($server);
        return !empty($ips);
    }