Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8136597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:48:42+00:00 2026-06-06T10:48:42+00:00

I have a really frustrating issue where I cannot retrieve any of the headers.

  • 0

I have a really frustrating issue where I cannot retrieve any of the headers. Here is my code:

$headers = getallheaders();
echo($headers["SystemTime"]); //Doesnt work
$keys = array_keys($headers);
echo($headers[$keys[4]]); //Doesnt work

Both lines produce the error ‘Undefined index: SystemTime’.

I cannot for the life of me figure out why I cant get the value. If I go print_r($headers); I get this

Array
(
    [Content-Type] => application/x-www-form-urlencoded
    [Content-Length] => 0
    [Host] => localhost
    [Referer] => 
    [SystemTime] => 2012-06-26+09%3a20%3a27
)

var_dump of $headers

array(5) {
  ["Content-Type"]=>
  string(33) "application/x-www-form-urlencoded"
  ["Content-Length"]=>
  string(1) "0"
  ["Host"]=>
  string(9) "localhost"
  ["Referer"]=>
  string(0) ""
  ["SystemTime"]=>
  string(23) "2012-06-26+10%3a10%3a08"
}

var_dump of $keys

array(5) {
  [0]=>
  string(12) "Content-Type"
  [1]=>
  string(14) "Content-Length"
  [2]=>
  string(4) "Host"
  [3]=>
  string(7) "Referer"
  [4]=>
  string(10) "SystemTime"
}

foreach ($headers as $name => $value) { 
   echo "$name: $value. From Array: {$headers[$name]}\n"; 
} 

returned:

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: 

Im stuck and I seriously cannot figure out what is going wrong. It should work.

PS. I know that the SystemTime header is non-standard. I provide that from my http_request.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:48:46+00:00Added an answer on June 6, 2026 at 10:48 am

    I got it after much help from you guys. I had a feeling that because it worked after the deserializing that maybe the encoding was different and thats why we could see it, but not touch it?

    My code below gets all the headers and converts the encoding and puts it in a new array 🙂

    Here is my ‘Translation’ code.

        $headersRaw = getallheaders();
        $headers = array();
        foreach($headersRaw as $key => $value)
        {
            $headers[mb_convert_encoding($key, "UTF-8")] = $value;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a really frustrating error that I've spent hours looking at and cannot
Here's a really frustrating Actionscript 2 problem I have with movie clips associated with
This is REALLY frustrating! I have a common library of code I use across
I have a really strange issue. I am working on a Java SWING application
I'm experiencing some really frustrating problems with the asihttprequest. When I run the code
I'm having a really frustrating problem I hope someone can help me with. Here
this is really frustrating me. this problem occurs when I have a particularly large
Got a really frustrating problem that doesn't seem to make any sense. I'm trying
This bug is really frustrating me and I am hoping the fine folks here
This is really frustrating I would appreciate some help with this. I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.