Multiple choice technology web technology

If you want to check whether your script has already sent headers then which of the following can be used?

  1. header()

  2. setcookie()

  3. headers_sent()

  4. sent()

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The headers_sent() function specifically checks whether HTTP headers have already been sent. header() sends headers, setcookie() also sends headers (cookies use HTTP headers), and sent() is not a valid PHP function for this purpose.