Thursday, May 4, 2017

What is use of header() function in php?

1. Header is used to redirect from current page to another:

header("Location: newpage.php");

2. Header is used to send HTTP status code.
header("HTTP/1.0 404 Not Found");

3. Header is used to send Send a raw HTTP header
header('Content-Type: application/pdf');

No comments:

Post a Comment