I cant understand the reason of following behaviour of getmxrr()
var_dump(getmxrr ( "www.yahoo.com" , &$mxhosts)); // output: boolean true
var_dump($mxhosts); // output: array empty
var_dump(getmxrr ( "www.google.com" , &$mxhosts)); // output: boolean false
var_dump($mxhosts); // output: null
I have refered many sites mentioning that www.
must be removed to get mx-records. But my aim is not to have mx-records but to understand the reason of this strange behaviour.
I expect some help from SO community.
Thanking you in anticipation.
Simple - there are just no MX records for www. subdomains in the common case. That would only make sense if you wanted to have an whatever@www.domain.tld
address. Since there are no MX records for the hostnames that you've tried - there's nothing to return