- print_r: documentation ( source)
- dns_get_record: documentation ( source)
<?php
function domain_availability($domains){
foreach ($domains as $domain)
{
$ns= @dns_get_record($domain,DNS_NS);
if(count($ns))
{
$rs[$domain]=0;
}
else
{
$rs[$domain]=1;
}
}
return $rs;
}
$domains=array("google.com","hsghjgsy.org","jsdhjs.es","aajjks.eu","sjdjsd.in");
$rs=domain_availability($domains);
print_r($rs);