$values = array('0', 1, 2);
if (in_array($values2, $values, false) || $values2 == 0) {
Values2 is the submitted value, and in this case it was 3, 3 isn't in the array, so shouldn't the if condition execute?
$values = array('0', 1, 2);
if (in_array($values2, $values, false) || $values2 == 0) {
Values2 is the submitted value, and in this case it was 3, 3 isn't in the array, so shouldn't the if condition execute?
To check if the value is not in the array, use the aptly named not operator:
if (!in_array($values2, $values, false) || $values2 == 0) {