• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/composite/helper.php
  • Класс: BitrixMainCompositecan
  • Вызов: can::getDomainName
static function getDomainName($url)
{
	$url = filter_var($url, FILTER_SANITIZE_URL);
	$url = trim($url, " tnrx0B/\");
	$components = parse_url($url);
	if (isset($components["host"]) && !empty($components["host"]))
	{
		return $components["host"];
	}
	elseif (isset($components["path"]) && !empty($components["path"]))
	{
		return $components["path"];
	}
	else
	{
		return $url;
	}
}