FREE Web Template Download
HTML CSS JAVASCRIPT SQL PHP BOOTSTRAP JQUERY ANGULARJS TUTORIALS REFERENCES EXAMPLES Blog
 

PHP filter-VALIDATE_FLOAT Filter


PHP Filter Reference Complete PHP Filter Reference

Definition and Usage

The filter-VALIDATE_FLOAT filter validates a value as a float number.

  • Name: "float"
  • ID-number: 259

Example

<?php
$var=12.3;

var_dump(filter-var($var, filter-VALIDATE_FLOAT));
?>

The output of the code will be:

float(12.3)

PHP Filter Reference Complete PHP Filter Reference