Php 如何在codeigniter中设置自定义标题?

Php 如何在codeigniter中设置自定义标题?,php,codeigniter-3,Php,Codeigniter 3,我正在尝试使用codeigniter框架设置自己的自定义请求头 我正在使用$this->input->request_header()函数查看所有请求的标题。您可以使用输出类。请注意,输出类与其他类/库不同,它是由系统自动加载的,因此您不必这样做 以下是设置不同标题的示例(来自CodeIgniter ) 嗨,欢迎来到StackOverflow。你会犯什么样的错误?您能提供一些代码示例吗?先生,请求头中没有设置头。。我想将标题发送到服务器端。 $this->output->set_he

我正在尝试使用codeigniter框架设置自己的自定义请求头


我正在使用
$this->input->request_header()
函数查看所有请求的标题。

您可以使用
输出类。请注意,
输出
类与其他类/库不同,它是由系统自动加载的,因此您不必这样做

以下是设置不同标题的示例(来自CodeIgniter )


嗨,欢迎来到StackOverflow。你会犯什么样的错误?您能提供一些代码示例吗?先生,请求头中没有设置头。。我想将标题发送到服务器端。
$this->output->set_header('HTTP/1.0 200 OK');
$this->output->set_header('HTTP/1.1 200 OK');
$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', $last_update).' GMT');
$this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate');
$this->output->set_header('Cache-Control: post-check=0, pre-check=0');
$this->output->set_header('Pragma: no-cache');