What is the common error message related to header modification in PHP?
The common error message related to header modification in PHP is "Cannot modify header information - headers already sent". This error occurs when there is whitespace or output sent before the header() function is called. To solve this issue, ensure that there is no output (such as echo, print, or whitespace) before calling the header() function.
<?php
ob_start(); // Start output buffering
// Your PHP code here
header("Location: https://www.example.com");
exit();
ob_end_flush(); // Flush the output buffer
?>