What is the purpose of using meta refresh in PHP scripts?

Using meta refresh in PHP scripts allows for automatically redirecting users to another page after a certain amount of time. This can be useful for situations where a user needs to be redirected to a different page after a form submission or any other action.

<?php
$url = 'http://www.example.com/newpage.php';
$delay = 5; // 5 seconds delay before redirecting

echo '<meta http-equiv="refresh" content="'.$delay.';url='.$url.'">';
?>