This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:is_numeric [2017/03/28 17:35] jeff |
uphp:functions:is_numeric [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
======is_numeric====== | ======is_numeric====== | ||
+ | |||
< | < | ||
- | Return 1 if the value is numeric (integer, float or numeric string) | + | < |
====Description==== | ====Description==== | ||
- | <well size=" | + | |
- | <span style=" | + | <well size=" |
- | < | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
- | <span style=" | + | <span style=" |
+ | <span style=" | ||
</ | </ | ||
- | Check if a value is numeric | + | Check to see if a value is numeric |
====Parameter==== | ====Parameter==== | ||
- | < | ||
- | ====Return | + | < |
- | 1 (true) if numeric, 0 (false) if not numeric (arrays always return 0) | + | |
+ | ====Return | ||
+ | |||
+ | < | ||
====Examples==== | ====Examples==== | ||
+ | |||
<code php> | <code php> | ||
<? | <? | ||
Line 35: | Line 40: | ||
</ | </ | ||
- | **Set up an array of different types of values. Then iterate through the array and output | + | ===Set up an array of different types of values, iterate through the array, output type, value and whether is_numeric() returns true or false=== |
<code php> | <code php> | ||
Line 83: | Line 88: | ||
====Notes==== | ====Notes==== | ||
+ | |||
Unlike functions [[is_int()]], | Unlike functions [[is_int()]], | ||
====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 < |
+ | |||
+ | [[is_float()]] - Check if a variable is a < | ||
- | [[is_string()]] - Return 1 if the variable is a string | + | [[is_string()]] - Check if a variable is a < |
- | [[is_array()]] - Return 1 if the variable is an array | + | [[is_array()]] - Check if a variable is an < |
- | [[isset()]] - Return 1 if the variable exists | + | [[isset()]] - Check if a variable exists |
[[uphp: | [[uphp: | ||
Line 100: | Line 107: | ||
[[uphp: | [[uphp: | ||
- | [[array()]] - Create an array, with optional values | + | [[array()]] - Create an < |