Can PHP be used to create a delay before redirection, similar to the meta-refresh in HTML?

Yes, PHP can be used to create a delay before redirection by using the `header()` function along with the `sleep()` function. By setting the header to redirect after a certain amount of time using the `Location` parameter, and then using the `sleep()` function to delay the redirection, you can achieve a similar effect to the meta-refresh in HTML.

<?php
// Set the delay time in seconds
$delay = 5;

// Set the redirection URL
$redirect_url = 'http://example.com';

// Set the header to redirect after the delay time
header("Refresh: $delay; URL=$redirect_url");

// Delay the redirection
sleep($delay);