Simplified headers tests: removed multiline headers (support is far too servers & browsers dependant) and made all the tests in a single request.
This commit is contained in:
parent
0b0889ceaa
commit
974637d639
3 changed files with 24 additions and 46 deletions
|
@ -1,5 +1,20 @@
|
|||
<?php
|
||||
|
||||
header( "Multiple-Line: Hello\n World" );
|
||||
header( "Multiple-Multiple-Line: Hello\n Beautiful\n\t World" );
|
||||
header( "Single-Line: Hello World" );
|
||||
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";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue