public function getEntries($domain)
    {
        $hosts  = array();
        $weight = array();

        getmxrr($domain, $hosts, $weight);

        // sort MX priorities
        foreach ($hosts as $k => $host) {
            $this->mxs[$host] = $weight[$k];
        }


        asort($this->mxs);

        // add the hostname with 0 weight (RFC 2821)
        $this->mxs[$domain] = 0;

        return $this->mxs;
    }
public function getEntries($domain)
    {
        $hosts  = array();
        $weight = array();

        getmxrr($domain, $hosts, $weight);

        // sort MX priorities
        foreach ($hosts as $k => $host) {
            $this->mxs[$host] = $weight[$k];
        }


        asort($this->mxs);

        // add the hostname with 0 weight (RFC 2821)
        $this->mxs[$domain] = 0;

        return $this->mxs;
    }
public function getEntries ( $ domain ) { $ hosts = array ( ) ; $ weight = array ( ) ; getmxrr ( $ domain , $ hosts , $ weight ) ; // sort MX priorities foreach ( $ hosts as $ k => $ host ) { $ this -> mxs [ $ host ] = $ weight [ $ k ] ; } asort ( $ this -> mxs ) ; // add the hostname with 0 weight (RFC 2821) $ this -> mxs [ $ domain ] = 0 ; return $ this -> mxs ; }
Queries the DNS server for domain MX entries

@param string $domain The domain MX entries

@return array         MX hosts and their weights
Queries the DNS server for domain MX entries