User Tools

Site Tools


uphp:functions:is_numeric

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:is_numeric [2017/03/27 20:54]
jeff
uphp:functions:is_numeric [2021/09/13 05:57] (current)
Line 1: Line 1:
 ======is_numeric====== ======is_numeric======
 +
 <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge> <badge>WMPRO, WMMINI FW >= 1.0</badge> <badge>WMMEGA FW >= 2.0</badge>
  
-Return 1 if the value is numeric (integer, float or numeric string)+<html>Check if 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>
  
 ====Description==== ====Description====
-<well size="sm"><html><span style="font-size:125%;color:green;">int + 
-<span style="color:black;"></html>[[is_numeric]] +<well size="sm"><html> 
-<html>+<span style="font-size:125%;color:green">int 
-<span style="color:green;">mixed +<span style="color:black">is_numeric ( 
-<span style="color:blue;">$value +<span style="color:green">mixed 
-<span style="color:black;">)+<span style="color:blue">$value 
 +<span style="color:black">)
 </html></well> </html></well>
  
-Check if a value is numeric+Check to see if a value is numeric
  
 ====Parameter==== ====Parameter====
-<html><span style="color:blue;"><b>value</b><span style="color:black;"></html>:  Variable or expression to be evaluated 
  
-====Return Value==== +<html><b><span style="color:blue">$value<span style="color:black"></b></html>:  Variable or expression to be evaluated 
-1 (true) if numeric, 0 (false) if not numeric (arrays always return 0)+ 
 +====Return Values==== 
 + 
 +<html><b><span style="color:green">Integer<span style="color:black"></b></html>:  1 (true) if numeric, 0 (false) if not numeric (arrays always return 0)
  
 ====Examples==== ====Examples====
 +
 <code php> <code php>
 <? <?
Line 35: Line 40:
 </code> </code>
  
-**Set up an array of different types of values. Then iterate through the array and output each element type, value and whether is_numeric() returns true or false:**+===Set up an array of different types of valuesiterate through the arrayoutput type, value and whether is_numeric() returns true or false===
  
 <code php> <code php>
Line 83: Line 88:
  
 ====Notes==== ====Notes====
 +
 Unlike functions [[is_int()]], [[is_float()]], [[is_string()]] and [[is_array()]] this function looks at more than just the type of the variable, it also checks strings to see if they are numeric. Unlike functions [[is_int()]], [[is_float()]], [[is_string()]] and [[is_array()]] this function looks at more than just the type of the variable, it also checks strings to see if they are numeric.
  
 ====See Also==== ====See Also====
-[[is_int()]] - Return 1 if the variable is an integer 
  
-[[is_float()]] - Return 1 if the variable is a float+[[is_int()]] - Check if a variable is an <html><b><span style="color:green">integer<span style="color:black"></b></html> 
 + 
 +[[is_float()]] - Check if variable is a <html><b><span style="color:green">float<span style="color:black"></b></html>
  
-[[is_string()]] - Return 1 if the variable is a string+[[is_string()]] - Check if variable is a <html><b><span style="color:green">string<span style="color:black"></b></html>
  
-[[is_array()]] - Return 1 if the variable is an array+[[is_array()]] - Check if variable is an <html><b><span style="color:green">array<span style="color:black"></b></html>
  
-[[isset()]] - Return 1 if the variable exists+[[isset()]] - Check if variable exists
  
 [[uphp:numbers|uPHP Numbers and Numeric Calculations]] [[uphp:numbers|uPHP Numbers and Numeric Calculations]]
Line 100: Line 107:
 [[uphp:variables|uPHP Variable Types and Limits]] [[uphp:variables|uPHP Variable Types and Limits]]
  
-[[array()]] - Create an array with values+[[array()]] - Create an <html><b><span style="color:green">array<span style="color:black"></b></html>, with optional values
  
uphp/functions/is_numeric.1490648040.txt.gz · Last modified: 2021/09/13 05:56 (external edit)