I have a loop where I loop through a number of domains and I ping theme: the loop looks as follows:
foreach ($rows[1] as $domains){
$domain='www.'.$domains;
$output = shell_exec('ping -c1 '.$domain.'');
echo "<pre>$output</pre>";
}
My question: is it possible to write out the resultant ip address for each looped domain?
Sure, just use gethostbyname (PHP docs). Example: