why php code does not go in show error or check_data function
<?php
$error_array = array();
if (isset($_REQUEST["welcome_already_seen"])) {
    check_data();
    if (count($error_array) != 0) {
        show_error();
        show_welcome();
    } else {
        handle_data();
    }
} else {
    show_welcome();
}
function show_welcome()
{
    echo "<form method='post'>
        <input type='text' name='flavor'>
        <input type='submit' value='submit'>
        <input type='hidden' name='welcome_already_seen' value='already_seen'>
        </form>";
}
function check_data()
{
    if ($_REQUEST["flavor"] == "") {
        $error_array[] = "<div style='color:red'>please enter flavor</div>";
    }
}
function show_error()
{
    global $error_array;
    foreach ($error_array as $err) {
        echo $err, "<br>";
    }
}
function handle_data()
{
    echo "flavor =";
    echo $_REQUEST["flavor"];
}
?>
why php code does not go in show error or check_data function is there any solution and tell what the problem within the code
 
     
     
    