What is the use of header() function in php ?

To send a raw HTTP header, the header() is used. Before any actual output is sent the header() must be called either by blank lines in a file, normal HTML, or from PHP. Before the header is called a common error is to read the code with require, or include, another file access function or functions, and have empty lines and spaces which are output. While using a single HTML/PHP the same problem exists.
 
It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called.

Fastmailsender
 
Back
Top