What does the error message "Cannot modify header" typically indicate in PHP?

The error message "Cannot modify header information - headers already sent" typically indicates that there was output sent to the browser before PHP attempted to modify header information. This can be caused by whitespace before the opening <?php tag, output generated by functions like echo or print, or even by including files that have whitespace or output before the opening <?php tag. To solve this issue, ensure that there is no output sent to the browser before calling functions like header() or setcookie().

&lt;?php
ob_start(); // Start output buffering

// Your PHP code here

ob_end_flush(); // Flush the output buffer