This is an old revision of the document!
WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0
Return the integer value of a number or string
Return the integer value by truncating the fractional component of the number
$value: A string with a leading number, or a number (int or float)
Integer value, or:
The maximum value possible is a signed integer in the range -2147483648 to 2147483647.
Convert the <html><span style=“color:green”>float<span style=“color:black”></html> '1.55' into an <html><span style=“color:green”>int<span style=“color:black”></html> which has a value of 1:
<? $f=1.55; $i=intval($f); print("The integer value of ".$f." is ".$i); ?>
The above example will output:
The integer value of 1.550000 is 1
floatval() - Return the floating point value of a number or string
strval() - Return the string equivalent of a number
is_numeric() - Return 1 if the value is numeric (int, float or numeric string)
ieee754toint() - Take a floating point value and return an IEEE-754 encoded integer (32 bit)
inttoieee754() - Take an IEEE-754 encoded integer (32 bit) and return a float