What potential issue can arise when using relative URLs instead of absolute URLs in the header() function for redirection in PHP?

When using relative URLs in the header() function for redirection in PHP, a potential issue that can arise is that the browser may interpret the URL relative to the current page, leading to unexpected behavior or errors. To solve this issue, it is recommended to use absolute URLs instead of relative URLs to ensure that the redirection works correctly across different pages and directories.

// Using absolute URL for redirection
header("Location: https://www.example.com/newpage.php");
exit();