További információ és részletes tematika innen elérhető:
http://tmpk.uni-obuda.hu/targykov/tantargy_kov--tmvtk11bne.html
// Domain class $server_name = $_SERVER['SERVER_NAME']; $http_host = $_SERVER['HTTP_HOST']; $s = explode('.', $server_name); $h = explode('.', $http_host); preg_match("/^(http:\/\/)?([^\/]+)/i", $http_host, $matches); $host = $matches[2]; // get host name from URL preg_match("/[^\.\/]+\.[^\.\/]+$/", $host, $matches); $domain = $matches[0]; // get last two segments of host name if ($server_name !== $domain){$domain_class = $s[0];} ?>