I am trying to find a way to check the headers that have already been set by PHP. Example:
<?php
header('Location: https://www.google.fr');
// Later in the code
$location = get_header('Location');
Obviously, the get_header
function does not exist and I can't find a way to access already set headers.
Is that even possible?
EDIT after comments:
headers_sent
is not the function I am looking for. This functions checks if the headers have already been sent to the client.