2010-12-09 19:34:28 +01:00
|
|
|
<?php
|
|
|
|
|
2010-12-11 02:41:39 +01:00
|
|
|
header( "Sample-Header: Hello World" );
|
2011-02-17 17:03:09 +01:00
|
|
|
header( "Empty-Header: " );
|
|
|
|
header( "Sample-Header2: Hello World 2" );
|
2010-12-11 02:41:39 +01:00
|
|
|
|
|
|
|
$headers = array();
|
|
|
|
|
2010-12-30 07:34:48 +01:00
|
|
|
foreach( $_SERVER as $key => $value ) {
|
|
|
|
|
2011-01-09 04:28:42 +01:00
|
|
|
$key = str_replace( "_" , "-" , substr( $key , 0 , 5 ) == "HTTP_" ? substr( $key , 5 ) : $key );
|
|
|
|
$headers[ $key ] = $value;
|
2010-12-30 07:34:48 +01:00
|
|
|
|
|
|
|
}
|
2010-12-11 02:41:39 +01:00
|
|
|
|
|
|
|
foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) {
|
2011-01-09 04:28:42 +01:00
|
|
|
echo "$key: " . @$headers[ strtoupper( $key ) ] . "\n";
|
2010-12-11 02:41:39 +01:00
|
|
|
}
|