// get last two segments of host name
preg_match("/[^./]+.[^./]+$/", $host, $matches);
Ausgabe?
echo "domain name is: {$matches[0]}<br>\n";
$domain=$matches[0];
// get last two segments of host name
preg_match("/[^./]+.[^./]+$/", $host, $matches);
$domain=$matches[0];