What is the correct format for the Location header in PHP, and why is it important to provide a complete URL?
When using the Location header in PHP to redirect users to a different page, it is important to provide a complete URL in the header value. This ensures that the redirect works correctly across different browsers and devices. Without a complete URL, some browsers may not interpret the redirect correctly, leading to potential issues for users.
<?php
// Redirect to example.com
header("Location: https://www.example.com");
exit;
?>