Requirements: Sometimes requests arrive at PHP to process requests, and many processes may be required by managers (e.g., reverse proxy, load balancer, etc.), and the intermediate process may delete the request header information, and use php to output all request headers for our debugging.
Apache server
Under the Apache server, you can directly use the PHP built-in function to obtain the HTTP request header information of the client, the code is as follows:
This function returns the header information of all HTTP requests. It then outputs each request header information through a loop through a loop. This method can print out all the request header information, including host, browser type, language, etc., which is very convenient for debugging.
IIS and Nginx servers
The above functions are not supported by IIS or Nginx, and can be implemented through custom functions, the code is as follows:
As shown below:
Resources:The hyperlink login is visible.
|