Current Location: Home> Function Categories> floatval

floatval

Get the floating point value of the variable
Name:floatval
Category:Variable processing
Programming Language:php
One-line Description:Returns the floating point value of the variable.

Definition and usage

floatval() function returns the floating point value of the variable.

Example

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

grammar

 floatval ( variable ) ;
parameter describe
variable Required. Specifies the variable to check. Must be a scalar type.
Similar Functions
Popular Articles