Use regular expressions.
$domain = $SERVER["SERVER_NAME"];
preg_match("/([A-Za-z0-9])./i", $domain, $aMatches);
echo $matches[0];
Something like that anyway.
if the current domain is "subdomain.domain.com", then that should match "subdomain".
Or maybe there's allready a php function for it? wouldn't surprise me, I forget half the functions that are available.
cya
-Adam 🙂