In what scenarios should the "Location:" header in PHP be used with an absolute URI, and why is this important for cross-server compatibility?

When using the "Location:" header in PHP to perform a redirect, it is important to use an absolute URI when redirecting to a different domain or server. This is crucial for cross-server compatibility because some browsers may not properly handle relative URLs in the "Location:" header when redirecting to a different domain. By using an absolute URI, you ensure that the redirect works correctly across different servers.

// Redirect to an absolute URI for cross-server compatibility
header('Location: https://www.example.com/newpage.php');
exit;