floatval
Get the floating point value of the variable
floatval()
function returns the floating point value of the variable.
Returns floating point values of different variables:
<?php $a = "1234.56789" ; echo floatval ( $a ) . "<br>" ; $b = "1234.56789Hello" ; echo floatval ( $b ) . "<br>" ; $c = "Hello1234.56789" ; echo floatval ( $c ) . "<br>" ; ?>
Try it yourself
floatval ( variable ) ;
parameter | describe |
---|---|
variable | Required. Specifies the variable to check. Must be a scalar type. |