I am using is_float()
to check if the number entered is float or not but it keeps throwing the echo()
message when I enter 3.00
. Is there any other solution to it? Or am I doing anything wrong?
Here is my code:
PHP:
if(!is_float($_POST["gpa"])){
echo "GPA must be in #.## format.";
}
HTML:
<input type="text" name="gpa" />