Find HTTP headers in PHP

Posted By: Matpal - March 10, 2011
To get HTTP headers PHP uses a predefined array $_SERVER.$_SERVER is an associative array.

$_SERVER contains information such as headers, paths, and script locations. The entries in this array are created by the web server. There is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed here.

Following PHP example will list all the information that $_SERVER contains

<?php

foreach($_SERVER as $key => $value)

{

echo "<b>$key</b>=>$value <BR>";



}

?>

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.