How does the optional "replace" parameter in the header function impact the behavior of headers in PHP?

The optional "replace" parameter in the header function in PHP determines whether a header should replace a previous similar header or not. If set to true, it will replace any existing header with the same name, while if set to false, it will append the new header value to any existing headers with the same name.

// Example of using the "replace" parameter in the header function
header('Content-Type: text/html', true); // Replace any existing Content-Type header
header('X-Frame-Options: DENY', false); // Append a new X-Frame-Options header