What are the potential pitfalls of using meta refresh for redirection in PHP?

Using meta refresh for redirection in PHP can cause issues with SEO, as search engines may not follow the redirection correctly. It can also affect user experience, as the redirection may not work as expected on all browsers or devices. To solve this issue, it's recommended to use PHP header() function for redirection instead.

<?php
header("Location: https://www.example.com");
exit();
?>