phpWhois.org/generic2.whois
2002-10-16 17:13:06 +00:00

36 lines
1,005 B
Text
Executable file

<?php
function generic_whois ( $rawdata, $items )
{
$r="";
while (list($key,$val)=each($rawdata))
{ if (trim($val)!="")
{ reset($items);
$ok=0;
while (list($field, $match)=each($items))
{ if (strstr($val,$match))
{ $parts=explode(".",$field);
$var="\$r";
while (list($fn,$mn)=each($parts))
if ($mn=="")
$var=$var."[]";
else $var=$var."[\"".$mn."\"]";
$itm=trim(substr($val,strlen($match)));
if ($itm!="")
eval($var."=\"".$itm."\";");
$ok=1;
break;
}
}
if ($ok==0 && $val[0]==" ")
eval($var."=\"".trim($val)."\";");
}
}
return $r;
}