Have a select situated like so:
$number = range(0,5);
<select name="amount">
foreach ($number as $key => $value) {
echo '<option value="' . $key . '">' . $value . '</option>';
}
</select>
The handling script contains:
if (!empty($_POST['amount'])) {
$a = mysqli_real_escape_string($dbc, $_POST['amount']);
$b = (integer)$a;
} else {
$b = false;
}
It works swimmingly enough, until a '0' $key-value buggers the handling script.
The script swears on a stack of manuals it's being fed something other than the integer 'zero'.
How does one get '0' (zero) to be - and stay as- the *number* zero, and not a NULL or FALSE, etc.
~ David