How can PHP be used to open a new window for redirection?

To open a new window for redirection using PHP, you can use the header() function along with JavaScript's window.open() method. First, use the header() function to set the Location header to the URL you want to redirect to. Then, use JavaScript within a script tag to open a new window with the specified URL.

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

// Open a new window using JavaScript
echo '<script>window.open("https://www.example.com");</script>';
?>