According to the PHP Manual
header() — Send a raw HTTP header
Now,
when I use following code :
header('location:form.html');
then, the header function immediately redirects the browser to form.html OR simply an HTTP response header is sent immediately after the execution of above line.
but when I use same header function to add some other header fields to the response header, for example:
header("X-Sample-Test: foo");
header('Content-type: text/plain');
then why doesn't it send an HTTP response header immediately?
First of all, correct me if I am wrong and secondly please do share more information on HTTP headers.