Checking for a floating point number : floatval « Data Type « PHP






Checking for a floating point number

 
if ($_POST['price'] != strval(floatval($_POST['price']))) {
    $errors[] = 'Please enter a valid price.';
}
  
  

Related examples in the same category