09-06-2008, 10:16 AM
|
#2 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 701
Thanks: 2
|
The relevant PHP Manual pages ( is_numeric, ctype_digit, is_integer) should provide a clear answer, but in short: - is_numeric checks if the argument has a numerical value (e.g. 123, "0xFF" [hexadecimal], 0123 [octal], "+012.345e6", 3.14 are all allowed)
- ctype_digit checks if all of the characters in a string are digits (e.g. 12345 is ok, 3.14 is not [the decimal point is not a digit!])
- is_integer (and is_int) checks if the argument is an integer (i.e. 23 is ok, "23" is not)
__________________
|
|
|
|