Why is using <meta http-equiv="refresh"> for headers not recommended in PHP scripts?

Using <meta http-equiv="refresh"> for headers in PHP scripts is not recommended because it relies on the client's browser to handle the redirection, which can lead to inconsistent behavior across different browsers. It is better to use the PHP header() function to send proper HTTP headers for redirection.

&lt;?php
// Redirect to a new page using PHP header
header(&quot;Location: newpage.php&quot;);
exit;
?&gt;