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
Loading...
Related Quiz
- OOP in PHP stands for Object-Oriented ______.
- The while loop in PHP will continue to execute a block of code as long as the ______ is true.
- What are the different types of encryption algorithms available in PHP? Explain their differences and use cases.
- A common use case for the $_GET superglobal in PHP is to collect the data sent in the ______.
- You are writing a PHP script and you need to establish an FTP connection. How would you do this?