In programming languages header information of request and response is very important. The header of request tells the behavior of request and header response tells the request is success or failed, In case failed you can also know the which type error was accrued with help of HTTP response code.
PHP provide is
getallheaders() to for get all header information.This function is used for fetches all HTTP headers from the current request.
getallheaders() is an alias for
You can also check other tutorial of PHP headers,
- How to Solve “Headers already sent” error in PHP
- How To Set HTTP Response Header in PHP
- How To Access Header Information in PHP
Simple Code to Get HTTP header Information
1 2 3 4
<?php echo"<pre>"; print_r(getallheaders()); ?>