getHeaderLine("Content-Type") ?? ""; foreach ($type as $t) { $pattern = "/^".preg_quote(trim($t), "/")."($|;|,)/i"; if (preg_match($pattern, $header)) { return true; } } return false; } }