What is the purpose of the header() function in PHP?

  • To send HTTP headers
  • To set the content type of a response
  • To redirect to a different page
  • All of the above
The header() function in PHP is used to send HTTP headers to the client browser. It can be used to set the content type, perform redirects, set cookies, and more. By sending appropriate headers, you can control the behavior of the browser and the server response. Learn more: http://php.net/manual/en/function.header.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *