src/Sulu/Component/Webspace/Manager/WebspaceManager.php
protected function isFromDomain($url, $domain)
    {
        if (!$domain) {
            return true;
        }

        $parsedUrl = parse_url($url);
        // if domain or subdomain
        if (
            isset($parsedUrl['host'])
            && (
                $parsedUrl['host'] == $domain
                || fnmatch('*.' . $domain, $parsedUrl['host'])
            )
        ) {
            return true;
        }

        return false;
    }
protected function isFromDomain($url, $domain)
    {
        if (!$domain) {
            return true;
        }

        $parsedUrl = parse_url($url);
        // if domain or subdomain
        if (
            isset($parsedUrl['host'])
            && (
                $parsedUrl['host'] == $domain
                || fnmatch('*.' . $domain, $parsedUrl['host'])
            )
        ) {
            return true;
        }

        return false;
    }
protected function isFromDomain ( $ url , $ domain ) { if ( ! $ domain ) { return true ; } $ parsedUrl = parse_url ( $ url ) ; // if domain or subdomain if ( isset ( $ parsedUrl [ 'host' ] ) && ( $ parsedUrl [ 'host' ] == $ domain || fnmatch ( '*.' . $ domain , $ parsedUrl [ 'host' ] ) ) ) { return true ; } return false ; }
Url is from domain.

@param $url
@param $domain

@return array
Url is from domain .