Is it possible to use the meta refresh tag in an IF loop in PHP?

Using the meta refresh tag in an IF loop in PHP is not recommended as it can cause unexpected behavior. Instead, you can achieve the same functionality by using PHP header() function to redirect the user to a different page based on a condition in the IF loop.

<?php
if ($condition) {
    header("Refresh: 5; URL=redirect_page.php");
    exit();
}
?>