So anyways, I\'m working on a small PHP website/script, and as one of the features I\'d like to be able to run a WHOIS lookup on the current domain the PHP script is running
To take Pavels answer one step further - this will break it down in to an array:
$whois = shell_exec("whois 45.118.135.255");
$result = explode("\n",$whois);
$out = array();
foreach ($result as $line){
if (substr($line,0,1) == '%' || substr($line,0,1) == '#'){ continue; }
$ps = explode(':',$line);
$out[trim($ps[0])] = trim($ps[1]);
}
print ''; print_r($out); print '
';