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