<?php // RAY_temp_sexyabs.php
error_reporting(E_ALL);
// TEST DATA FROM THE POST AT EE
$array = array("google.com", "yahoo.com", "ihavenomx.com");
// WHERE TO KEEP THE INFORMATION
$mxrecords = array();
// AN ITERATOR
foreach ($array as $domain)
{
// MAN PAGE: http://us2.php.net/manual/en/function.getmxrr.php
$x = getmxrr($domain, $mx_host, $mx_weight);
// ADD THE RESULTS TO THE KEEPING ARRAY
$mxrecords[$domain]
= array
( 'mx_exists' => $x
, 'mx_host' => $mx_host
, 'mx_seight' => $mx_weight
)
;
}
// SHOW THE WORK PRODUCT
echo "<pre>" . PHP_EOL;
var_dump($mxrecords);
|