In what scenarios should absolute URIs be used in the header() function for redirection in PHP?

Absolute URIs should be used in the `header()` function for redirection in PHP when you want to ensure that the redirection works correctly across different domains or subdomains. This is important because relative URLs may not work as expected in these scenarios. By using absolute URIs, you can specify the full path to the destination resource, including the protocol (http:// or https://), domain, and path.

// Redirect to an absolute URI using the header() function
$redirect_url = 'http://www.example.com/new_page.php';
header('Location: ' . $redirect_url);
exit();