PHP help
PHP help
- Started
- Last post
- 5 Responses
- heavyt
OK, i am a noob at PHP, and i have a question;
I have a form value which is setting the max value of a random number generator.
i am checkign that it is a number by usign is_numeric, but i would also like to test to see that it is an integer. I have tried puttin is_int in the if else, but it seems that the value remains a string.
any help on this?
TR1
- chl0
You can always just cast it. If the variable is called $foo, do a line like this.
$foo = (int) $foo;
Should be what you want.
- abizzyman0
truly most not cool
- abizzyman0
oops... wrong thread. :)