1--TEST-- 2bool dns_get_mx ( string $hostname , array &$mxhosts [, array &$weight ] ); 3--CREDITS-- 4marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br 5--SKIPIF-- 6<?php 7if (getenv("SKIP_SLOW_TESTS")) 8 die("skip slow test"); 9if (getenv("SKIP_ONLINE_TESTS")) 10 die("skip test requiring internet connection"); 11if (substr(PHP_OS, 0, 3) == 'WIN') { 12 die('skip: no Windows support'); 13} 14?> 15--FILE-- 16<?php 17$domains = array('yahoo.co.jp', 'yahoo.com', 'es.yahoo.com', 'fr.yahoo.com', 'it.yahoo.com'); 18foreach ($domains as $domain) { 19 if (getmxrr($domain, $hosts, $weights)) { 20 echo "Hosts: " . count($hosts) . ", weights: " . count($weights) . "\n"; 21 } 22} 23?> 24--EXPECTF-- 25Hosts: %i, weights: %i 26Hosts: %i, weights: %i 27Hosts: %i, weights: %i 28Hosts: %i, weights: %i 29Hosts: %i, weights: %i 30