• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/web/httpheaders.php
  • Класс: BitrixMainWebHttpHeaders
  • Вызов: HttpHeaders::getContentTypeAttribute
public function getContentTypeAttribute(string $attribute)
{
	$contentType = $this->get('Content-Type');
	if ($contentType !== null)
	{
		$attribute = strtolower($attribute);
		$parts = explode(';', $contentType);

		foreach ($parts as $part)
		{
			$values = explode('=', $part);
			if (strtolower(trim($values[0])) == $attribute)
			{
				return trim($values[1]);
			}
		}
	}

	return null;
}