what is Header() function in PHP?

Discussion in 'PHP' started by ifuturz, May 21, 2012.

Thread Status:
Not open for further replies.
  1. ifuturz

    ifuturz Banned

    Joined:
    Apr 16, 2012
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Open Source Developer
    Location:
    Anaheim
    Home Page:
    http://www.ifuturz.com/
    what is Header() function in PHP and For what is this function used in PHP language?
     
  2. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    736
    Likes Received:
    39
    Trophy Points:
    28
  3. alia123

    alia123 New Member

    Joined:
    Jan 8, 2016
    Messages:
    65
    Likes Received:
    5
    Trophy Points:
    0
    Hey,The header() function sends a raw HTTP header to a client.
    It is important to notice that header() must be called before any actual output is sent
    -Syntax:
    header(string,replace,http_response_code)

    string -Required. Specifies the header string to send
    replace- Optional. Indicates whether the header should replace previous or add a second header.
    http_response_code -Optional.
     
  4. arkasoftwares

    arkasoftwares New Member

    Joined:
    Jan 27, 2016
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    web development and designing
    Location:
    Jaipur, Rajasthan,India
    PHP headers are bits of information that are sent to a computer before anything else, like a web page, is sent. They tell the computer the information it needs so that it can execute commands when the rest of the information is recieved. When you view a website in a browser, you will never see these headers. They come before the webpage and all the browser will display is the content of the web page. In a PHP document, a developer can change the headers that are sent to the browser. They must come before any of your other content on the page. You put them right before you declare the DOCTYPE with no space before the PHP tag.
     
  5. joeykordahi22

    joeykordahi22 New Member

    Joined:
    Apr 5, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Lagos,Nigeria
    Type your query in Google Search you'll get better results, don't post such meaningless questions for just link juice. Try to improve level of your question!!
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice