Q:

PHP: isset () not working (false negatives)

Okay, I know that there are a few of these questions already on SO; but they don't actually solve my problem.
For this (cut-down) html form:
<!DOCTYPE html><html><head><title>test</title></head><body>
        <form method="post" autocomplete="on" action="application6.php">
            <p>
                <input  type="text" name="fullname" id="fullname" maxlength="50" size="30">
                <label for="fullname">*Full Name</label>
            </p>
            <p>
                <input  type="text" name="email" id="email" maxlength="50" size="30">
            </p>
            <p>
                <select name="hours" id="hours">
                    <option value="" disabled="disabled" selected="selected">*Hours</option>
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                </select>
            </p>
    </body>
</html>

I have the following code 
$error_array = array(
    " "
);

echo ("debug: ");
print_r($_POST);

$variables = array(
    'fullname',
    'email',
    'hours'
);

foreach ($variables as $variable_name) {

    if (isset($_POST[$variable_name])) {
        echo 'Variable: ' . $variable_name . ' is not set<br/>';
        array_push($error_array, " " . $variable_name);
    }

}

This results, in the submission of a blank form, in the output of

debug: Array ( [fullname] => [email] => )

An alternative is to check if these elements are empty(), but empty() will return false positives for when "hours" is set to 0.  
Why are these elements incorrectly registering as being set, and what means can successfully test inputs of different types?

A:

The problem is in your logic, you check if $_POST[whatever] isset, and if so, you then output "Variable is NOT set" this is the opposite of what you're if statement checks. Try adding a ! in front of isset:
if (!isset($_POST[$variable_name])) {
    echo 'Variable: ' . $variable_name . ' is not set<br/>';
    array_push($error_array, " " . $variable_name);
}

