What are the potential consequences of outputting content before using the header() function for redirection in PHP?

Outputting content before using the header() function for redirection in PHP can result in the "Headers already sent" error because headers must be sent before any content. To solve this issue, make sure to call the header() function before any content is output to the browser.

<?php
// Correct way to redirect without outputting content first
header("Location: new_page.php");
exit;
?>