How can I print the values set in the header of a received request using CodeIgniter?
I tried print_r($_SERVER);
which doesn't help me. I'm hoping there's a different way using CI.
How can I print the values set in the header of a received request using CodeIgniter?
I tried print_r($_SERVER);
which doesn't help me. I'm hoping there's a different way using CI.
Simply use,
$this->input->request_headers();
If you are sending values from form submit,
$_REQUEST will help you
or
$this->input->post();
$this->input->get();
$this->input->request_headers();
was what I was looking for.
To receive all values from the request header
$valuesInHeader = $this->input->request_headers();
To get specific value from request header
$hostValueInHeader = $this->input->request_headers()['Host'];
//"Host" is a key of a value, you can use your required key.