How can headers be used to redirect to a different page in PHP, and what are the limitations?

To redirect to a different page in PHP, you can use the `header()` function with the `Location` parameter set to the URL of the page you want to redirect to. However, it's important to note that headers must be sent before any output is generated, so make sure there is no HTML content or whitespace before the `header()` function is called.

<?php
// Redirect to a different page
header("Location: https://www.example.com/newpage.php");
exit;
?>