Home > PHP > Function > Variable handling > floatval()

floatval()

floatval - Get float value of a variable

Syntax

float floatval (mixed $var)

Arguments

  • var - May be any scalar type. floatval() should not be used on objects, as doing so will emit an E_NOTICE level error and return 1.

Description

Gets the float value of var.

Version

PHP 4.2.0, 5

Return value

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