What function can be used to retrieve HTTP request headers in PHP?

To retrieve HTTP request headers in PHP, you can use the `getallheaders()` function. This function returns an associative array containing all the HTTP headers sent in the current request. You can then access specific headers by using their keys in the array.

$headers = getallheaders();

foreach ($headers as $key => $value) {
    echo "$key: $value <br>";
}