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

  • Home
  • SEARCH
  • 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 404609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:19:26+00:00 2026-05-12T17:19:26+00:00

i using get_headers Function in PHP to request headers from website in local server

  • 0

i using get_headers Function in PHP to request headers from website
in local server return arrays
put when use in my website Does not return arrays

examples for returns

in local server

Array
(
    [0] => HTTP/1.1 301 Moved
    [Server] => Array
        (
            [0] => nginx/0.7.42
            [1] => Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4
            [2] => Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4
            [3] => Microsoft-IIS/7.0
        )
    [Content-Type] => Array
        (
            [0] => text/html; charset=utf-8
            [1] => text/html; charset=iso-8859-1
            [2] => text/html
            [3] => text/html; charset=utf-8
        )
    [Location] => Array
        (
            [0] => http//3.ly/aXP
            [1] => http//3.ly/aXP/
            [2] => http//stackoverflow.com
        )
    [MIME-Version] => 1.0
    [Content-Length] => Array
        (
            [0] => 277
            [1] => 376
            [2] => 0
            [3] => 122213
        )
)

in real server

Array
(
    [0] => HTTP/1.1 301 Moved
    [Server] => nginx/0.7.42
    [Date] => Sat, 10 Oct 2009 03:15:32 GMT
    [Content-Type] => text/html; charset=utf-8
    [Connection] => keep-alive
    [Location] => http//3.ly/aXP
    [MIME-Version] => 1.0
    [Content-Length] => 277
)

i wont to return arrays

thanks….

  • 1 1 Answer
  • 1 View
  • 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-05-12T17:19:26+00:00Added an answer on May 12, 2026 at 5:19 pm

    There seems to be a difference in how PHP handles redirects on your local server and on the real server. I think you would get arrays locally too, but for some reason get_headers() locally doesn’t seem to follow redirects.

    Is the PHP version same in both environments?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The PHP code won't delete item from database using $noteid. If I put a
I am making a POST request from IE using XDomainRequest . XDomainRequest does not
I am using get_headers() and I want to return the content length. In the
I'm using plupload to upload files to my server ( http://www.plupload.com/index.php ), however I
I am having C function. From the html page, through ajaxcall the request is
I am trying to read file headers using java, I want to get file
I start a download using PHP with this code: <? $_REQUEST['file'] = urldecode($_GET['file']); header(Content-type:
I'm using get_by_id() to read entities from NDB and I do not get it
I am using the Thumbalizr API for capturing website screenshots. I am trying to
I use a PHP script to validate video requests before serving them. This script

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.