How to check if header () is set in PHP?

Is it possible there is any header information set so far in PHP?

+3
source share
2 answers

Give it a try headers_sent().

PHP docs on headers_sent () .

You can also get the headers for the get_headers () page and list them using headers_list () . I'm a bit confused, though, you mean you want to check if something like header("Location: /path/to/location");this is caused ?

+6
source
+3

Source: https://habr.com/ru/post/1762121/


All Articles