Source: programmingdive.com

What is header() function in PHP?

Category: PHP

In this tutorial, we’ll see what is header() function in PHP, its importance, and its uses. So, when HTML webpage renders in the user’s browser then HTTP request’s header first & then the body as a second but it is all received in one HTTP response.

header() function in PHP is used to send raw HTTP header and it must be called before any output is sent to the requester, either by normal HTML tags, blank lines in a file, or from PHP.

The advantages of header function is that we can create and download file on the fly.

I hope that I have covered all the related information about what is header() function in PHP and it’s related uses.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners