aboutsummaryrefslogtreecommitdiffstats
path: root/test/data/headers.php
blob: f2c21c0ccffcd316cd578a800aa7433fd7c20c94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

header( "Sample-Header: Hello World" );

$headers = array();

foreach( $_SERVER as $key => $value ) { 
	
	if ( substr( $key , 0 , 5 ) == "HTTP_" ) { 
		
		$key = str_replace( "_" , "-" , substr( $key , 5) );
		$headers[ $key ] = $value;

	}
	
} 

foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) {
	echo "$key: " . $headers[ strtoupper( $key ) ] . "\n";
}