What does the error "Cannot modify header information - headers already sent" in PHP indicate?

The error "Cannot modify header information - headers already sent" in PHP indicates that there was output (such as echo, print, or whitespace) sent to the browser before the header() function was called to set HTTP headers. To solve this issue, make sure that no output is sent before calling header() functions, or use output buffering to capture the output before sending headers.

<?php
ob_start(); // Start output buffering

// Your PHP code here

ob_end_flush(); // Flush the output buffer