Are there alternative methods for redirection in PHP without using sleep function?

Using the sleep function for redirection in PHP can cause delays and slow down the user experience. An alternative method for redirection is to use the header function with a refresh meta tag in the HTML output. This method allows for immediate redirection without the need for a delay.

<?php
header("Refresh: 5; url=redirected_page.php");
echo "<html><head><meta http-equiv='refresh' content='5;url=redirected_page.php'></head><body>";
echo "You will be redirected in 5 seconds...";
echo "</body></html>";
?>