What are the implications of outputting content before using the header function for redirection in PHP?

Outputting content before using the header function for redirection in PHP can lead to "headers already sent" errors. To solve this issue, make sure to not output any content (including whitespace) before using the header function for redirection.

<?php
ob_start(); // Start output buffering
// Output any content here
ob_end_clean(); // Clean the output buffer without sending content to the browser

// Perform redirection after output buffering
header("Location: new_page.php");
exit;
?>