开发者

How to check whether header() has been set in PHP?

Is there possible whether there a开发者_如何学编程re some header information set so far in PHP?


Try headers_sent().

PHP docs on headers_sent().

You can also retrieve the headers for a page with get_headers() and list them with headers_list(). I'm a bit confused though, do you mean you want to check if something like header("Location: /path/to/location"); has been called?


Try using header_list() to determine what headers are ready to be sent to the client. Use headers_sent() to check if headers have been sent to the client.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜