How can PHP be used to handle redirection on a website?
When a website needs to redirect users to a different page, PHP can be used to handle the redirection by sending an HTTP header with the location of the new page. This can be useful for scenarios like redirecting users after a form submission or when a specific condition is met.
<?php
// Redirect to a new page
header("Location: https://www.example.com/newpage.php");
exit;
?>