User Tools

Site Tools


uphp:functions:intval

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

uphp:functions:intval [2017/05/08 14:29]
jeff
uphp:functions:intval [2021/09/13 05:57]
Line 1: Line 1:
-======intval====== 
- 
-<badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> 
- 
-<html>Return the <b><span style="color:green">integer<span style="color:black"></b> value of a <b><span style="color:green">number<span style="color:black"></b> or <b><span style="color:green">string<span style="color:black"></b></html> 
- 
-====Description==== 
- 
-<well size="sm"> 
-<html> 
-<span style="font-size:125%;color:green">int 
-<span style="color:black">intval ( 
-<span style="color:green">mixed 
-<span style="color:blue">$value 
-<span style="color:black">) 
-</html> 
-</well> 
- 
-Return the <html><b><span style="color:green">integer<span style="color:black"></b></html> value by truncating the fractional component of the number 
- 
-====Parameter==== 
- 
-<html><b><span style="color:blue">$value<span style="color:black"></b>:  A <b><span style="color:green">string<span style="color:black"></b> with a leading number, or a <b><span style="color:green">number<span style="color:black"></b> (<b><span style="color:green">int<span style="color:black"></b> or <b><span style="color:green">float<span style="color:black"></b>)</html> 
- 
-====Return Value==== 
- 
-<html><b><span style="color:green">Integer<span style="color:black"></b></html> value, or: 
-  * 0 on failure (for example, strings without a numeric in the leftmost characters) 
-  * 0 on empty <html><b><span style="color:green">array<span style="color:black"></b></html> 
-  * 1 on non-empty <html><b><span style="color:green">array<span style="color:black"></b></html> 
-The maximum value possible is a signed <html><b><span style="color:green">integer<span style="color:black"></b></html> in the range -2147483648 to 2147483647. 
- 
-====Example==== 
- 
-===Convert the float '1.55' into an integer which has a value of '1'=== 
- 
-<code php> 
-<? 
-  $f=1.55; 
-  $i=intval($f); 
-  print("The integer value of ".$f." is ".$i); 
-?> 
-</code> 
- 
-The above example will output: 
-<code> 
-The integer value of 1.550000 is 1 
-</code> 
- 
-====See Also==== 
- 
-[[floatval()]] - <html>Return the <b><span style="color:green">float<span style="color:black"></b> value of a <b><span style="color:green">number<span style="color:black"></b> or <b><span style="color:green">string<span style="color:black"></b></html> 
- 
-[[strval()]] - <html>Return the <b><span style="color:green">string<span style="color:black"></b> equivalent of a <b><span style="color:green">number<span style="color:black"></b></html> 
- 
-[[is_numeric()]] - <html>Check if a value is numeric (<b><span style="color:green">int<span style="color:black"></b>, <b><span style="color:green">float<span style="color:black"></b> or numeric <b><span style="color:green">string<span style="color:black"></b>)</html> 
- 
-[[ieee754toint()]] - <html>Convert a <b><span style="color:green">float<span style="color:black"></b> value to an IEEE-754 encoded <b><span style="color:green">integer<span style="color:black"></b> (32 bit)</html> 
- 
-[[uphp:variables|uPHP Variable Types and Limits]] 
  
uphp/functions/intval.txt · Last modified: 2021/09/13 05:57 (external edit)