= 3) { // Return the second-to-last and third-to-last parts return $parts[$count - 2]; } // For hostnames with just domain and TLD (2 parts) else if ($count == 2) { // Return just the domain part (without the TLD) return $parts[0]; } // If it's a single part hostname else { return $hostname; } } $domain = getDomain($_SERVER['SERVER_NAME']); $config_location = ((file_exists(dirname(__FILE__,2).'/custom/'.$domain.'/settings/'.$domain.'_config.php')) ? dirname(__FILE__,2).'/custom/'.$domain.'/settings/'.$domain.'_config.php' : dirname(__FILE__).'/config.php'); include $config_location; ?>