'How to read the php request header values? [duplicate]

so I have to read the curl header request value in PHP, basically, I have to take the CRSF token and cookie value from the request header and then post those values in the post header to bypass the login authentication.

I tried header out and header true in cURL options but it only retrieve the response header value.

curl_setopt($ch, CURLOPT_HEADER, true); 
curl_setopt($ch, CURLINFO_HEADER_OUT, true); 

Values I want to read from request header:

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source