Welcome Guest, Not a member yet? Register   Sign In
how to edit
#15

[eluser]Chris Newton[/eluser]
is_numeric checks to see if it's a number. ctype_digit checks to see if the variable's all digits: 100.1 contains a '.' which is not a number. is_int checks the type as well as the content. A form input is always a string, so ctype_digit will check to see if the string contains only numbers, which is in effect a non-typed integer. If your primary concern is that you're getting an integer value, ctype_digit will work fine. If you also want' to confirm that it's typed as an integer, you'll need to use is_int() as well... if your input is from a form or a uri string, is_int will always fail.


Messages In This Thread
how to edit - by El Forum - 05-27-2008, 03:47 PM
how to edit - by El Forum - 05-27-2008, 05:00 PM
how to edit - by El Forum - 05-27-2008, 10:26 PM
how to edit - by El Forum - 05-28-2008, 06:28 AM
how to edit - by El Forum - 05-28-2008, 09:07 AM
how to edit - by El Forum - 05-28-2008, 09:36 AM
how to edit - by El Forum - 05-28-2008, 10:04 AM
how to edit - by El Forum - 05-28-2008, 12:10 PM
how to edit - by El Forum - 05-28-2008, 01:13 PM
how to edit - by El Forum - 05-28-2008, 03:50 PM
how to edit - by El Forum - 05-28-2008, 04:25 PM
how to edit - by El Forum - 05-28-2008, 05:42 PM
how to edit - by El Forum - 05-28-2008, 06:28 PM
how to edit - by El Forum - 05-28-2008, 06:30 PM
how to edit - by El Forum - 05-28-2008, 08:18 PM
how to edit - by El Forum - 05-28-2008, 11:05 PM
how to edit - by El Forum - 05-28-2008, 11:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB