PHP function floatval()

Availability in versions: PHP 4.2.0

Get float value of a variable

Parameters

Parameter Data type Default value Note
$var mixed not

Return values

float

value of the given variable. Empty arrays return 0, non-empty arrays return 1.

Other resources

Official documentation of the floatval function

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.