FILTER_VALIDATE_FLOAT constant in PHP

PHPProgrammingServer Side Programming

The FILTER_VALIDATE_FLOAT constant validates a value as a float number.

Return

The FILTER_VALIDATE_FLOAT constant does not return anything.

Example

 Live Demo

<?php
   $var = 291.9;
   var_dump(filter_var($var, FILTER_VALIDATE_FLOAT));
?>

Output

The following is the output.

float(291.9)
raja
Updated on 27-Dec-2019 10:21:28

Advertisements