title: PHP Weird Undefined index error
body: <p>I have a really frustrating issue where I cannot retrieve any of the headers. Here is my code:</p>
  
  <pre><code>$headers = getallheaders();
  echo($headers["SystemTime"]); //Doesnt work
  $keys = array_keys($headers);
  echo($headers[$keys[4]]); //Doesnt work
  </code></pre>
  
  <p>Both lines produce the error 'Undefined index: SystemTime'.</p>
  
  <p>I cannot for the life of me figure out why I cant get the value. If I go <code>print_r($headers);</code> I get this</p>
  
  <pre><code>Array
  (
      [Content-Type] =&gt; application/x-www-form-urlencoded
      [Content-Length] =&gt; 0
      [Host] =&gt; localhost
      [Referer] =&gt; 
      [SystemTime] =&gt; 2012-06-26+09%3a20%3a27
  )
  </code></pre>
  
  <p>var_dump of $headers</p>
  
  <pre><code>array(5) {
    ["Content-Type"]=&gt;
    string(33) "application/x-www-form-urlencoded"
    ["Content-Length"]=&gt;
    string(1) "0"
    ["Host"]=&gt;
    string(9) "localhost"
    ["Referer"]=&gt;
    string(0) ""
    ["SystemTime"]=&gt;
    string(23) "2012-06-26+10%3a10%3a08"
  }
  </code></pre>
  
  <p>var_dump of $keys</p>
  
  <pre><code>array(5) {
    [0]=&gt;
    string(12) "Content-Type"
    [1]=&gt;
    string(14) "Content-Length"
    [2]=&gt;
    string(4) "Host"
    [3]=&gt;
    string(7) "Referer"
    [4]=&gt;
    string(10) "SystemTime"
  }
  
  foreach ($headers as $name =&gt; $value) { 
     echo "$name: $value. From Array: {$headers[$name]}\n"; 
  } 
  </code></pre>
  
  <p>returned:</p>
  
  <pre><code>Connection: Keep-Alive. From Array: Keep-Alive
  Content-Type: application/x-www-form-urlencoded. From Array: application/x-www-form-urlencoded
  Content-Length: 0. From Array: 0
  Host: localhost. From Array: localhost
  Referer: . From Array: 
  
  Notice:  Undefined index:  SystemTime in /clientdata/apache-www/a/d/[XXXXXX].com/www/admin/request/GetPCLicence.php on line 22
  SystemTime: 2012-06-26+10%3a10%3a08. From Array: 
  </code></pre>
  
  <p>Im stuck and I seriously cannot figure out what is going wrong. It should work.</p>
  
  <p>PS. I know that the SystemTime header is non-standard. I provide that from my http_request.</p>