======is_numeric====== WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0 Check if a value is numeric (int, float or numeric string) ====Description==== int is_numeric ( mixed $value ) Check to see if a value is numeric ====Parameter==== $value: Variable or expression to be evaluated ====Return Values==== Integer: 1 (true) if numeric, 0 (false) if not numeric (arrays always return 0) ====Examples==== ===Set up an array of different types of values, iterate through the array, output type, value and whether is_numeric() returns true or false===
The above example will output: The int '1337' is numeric The int '1337' is numeric The int '1337' is numeric The int '1337' is numeric The int '-25' is numeric The float '42.799999' is numeric The float '-365.011138' is numeric The string '42.9' is numeric The string 'no numbers' is NOT numeric The string '123 with numbers' is NOT numeric The array is NOT numeric ====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. ====See Also==== [[is_int()]] - Check if a variable is an integer [[is_float()]] - Check if a variable is a float [[is_string()]] - Check if a variable is a string [[is_array()]] - Check if a variable is an array [[isset()]] - Check if a variable exists [[uphp:numbers|uPHP Numbers and Numeric Calculations]] [[uphp:variables|uPHP Variable Types and Limits]] [[array()]] - Create an array, with optional values