How can the success of a URL redirection be visually indicated to the user in PHP?

After a URL redirection in PHP, the success can be visually indicated to the user by displaying a message or using a specific HTTP status code. One common way is to use the header() function to send a "Location" header with the new URL and a 3xx status code, indicating a successful redirection.

<?php
$newURL = "https://www.example.com/newpage.php";
header("Location: $newURL", true, 302);
exit();
?>