PeterdeB
asked on
How to modify this code?
Hi Folks, I have some code to query a domain but now I'd like to query multiple domains at once using a for loop or something.
Perhaps the supplied code can be turned into a function which takes a domain as param? If you need more info please ask.
Regards Peter
Perhaps the supplied code can be turned into a function which takes a domain as param? If you need more info please ask.
Regards Peter
<?php
require_once "Whois.php";
$server = "whois.denic.de";
$query = "autoverzekering-tarieven.nl"; // get information about this domain
$whois = new Net_Whois;
$data = $whois->query($query, $server);
echo $data;
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Using it as a function, will get you this:
Will this do?
Will this do?
<?php
require_once "Whois.php";
function getWhoisData($domain)
{
$server = "whois.denic.de";
$whois = new Net_Whois;
return $whois->query($domain, $server);
}
echo getWhoisData("autoverzekering-tarieven.nl");
echo getWhoisData("fietsverzekering-tarieven.nl");
//etc.
?>
ASKER
Thanks for the replies folks.
@Ray > I will post another question in an attempt to use the function you supplied.
Regards,
Peter
@Ray > I will post another question in an attempt to use the function you supplied.
Regards,
Peter
Open in new window