$host = explode(':', $_SERVER['HTTP_HOST']);
$host = explode(':', $_SERVER['HTTP_HOST']);
function get_domain_and_subdomains()
{
$http_host_arr = explode('.', $_SERVER['HTTP_HOST']);
$http_host_arr = array_reverse($http_host_arr);
// Основной домен
$http_host = $http_host_arr[1] .'.'. $http_host_arr[0];
unset($http_host_arr[0], $http_host_arr[1]);
foreach ($http_host_arr as $value)
$http_subs[] = $value;
if ( ! isset($http_subs)) {
$http_subs = array();
return array(
'domain' => $http_host,
'subdomains' => $http_subs
);
}
Цитата (inpost @ 23.01.2012 - 18:21) |
Ты к нам вернулся? |