What are the advantages and disadvantages of using meta refresh as an alternative to header() in PHP?

When redirecting users to a new page in PHP, using the header() function is the recommended method as it sends an HTTP header to the browser, instructing it to redirect to a different URL. However, in some cases, using meta refresh in the HTML <head> section can be an alternative method. Using meta refresh has the advantage of being able to specify a delay before redirecting, which can be useful for displaying a message before redirecting. However, it is not as reliable as header() as it relies on the browser to interpret the meta tag correctly. Additionally, using meta refresh can also have SEO implications as search engines may not follow the redirect.

// Using header() function for redirection
header(&quot;Location: newpage.php&quot;);
exit();