I need to (check) if my input is float but I cannot get it to work.
$input_number = trim($_POST['number']);
if(empty($input_number)){
$input_number_err = 'an error msg';
} elseif(is_float($input_number)){
$number = $input_number;
} else{
$input_number_err = 'an error msg';
}
I also tried to add 0 inside my if statement but nothing changed
elseif(is_float($input_number + 0))
+0)+0(assuming that your$_POST["number"]is a string); you shouldvar_dumpyour$_POSTand see what that actually shows