What are the best practices for handling page redirection in PHP to ensure compatibility with different browsers and devices?

When handling page redirection in PHP, it is important to use the appropriate method that is compatible with different browsers and devices. One common method is using the header() function with the Location header to redirect the user to a new page. This method ensures compatibility and proper redirection across various platforms.

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