hehe bende switch ile yazmamışım

function kontrolet($domain){

if(eregi("\.us",$domain)) {
$nomatch = 'Not found';
$server = 'whois.nic.us';
} elseif(eregi("\.org",$domain)) {
$nomatch = 'NOT FOUND';
$server = 'whois.publicinterestregistry.net';
} elseif(eregi("\.biz",$domain)) {
$nomatch = 'Not found';
$server = 'whois.neulevel.biz';
} elseif(eregi("\.info",$domain)) {
$nomatch = 'NOT FOUND';
$server = 'whois.afilias.info';
}

    $output="";
    if(($sc = @fsockopen($server, 43,$errno,$errstr,8))==false){ $hym = "bilinmiyor"; } else {
    fputs($sc, "$domain\n");
    while(!feof($sc)){$output.=fgets($sc, 50);}
    fclose($sc);

    if (eregi($nomatch, $output)){
	$hym = "bos";
    }else{
		$hym = "dolu";
    }
	
	}
	return $hym; 
}

$durum = kontrolet('haymac.biz');
echo " Haymac.biz şu anda $durum";