Well, here is my humble explaination of what is going on. Without digging into the actual php source code to see if I am correct, my assumption is this:
The is_int() function is used to check if a variable has been instantiated as an integer type; not to see if the contents of the variable evalute to an integer. This is a subtle distinction, but not a minor one. Consider the following:
$a = 5;
$b = '5';
if (is_int($a)) { echo "got an int!"; } // prints "got an int!
if (is_int($b)) { echo "got an int!"; } // does not print "got an int!"
The kicker is that since form fields are invariable <INPUT TYPE="TEXT">, php is probably instantiating the variables as strings, thus the failed is_int() comparison.
But how does all this affect what you are trying to do? Well, the bottom line is that you can't use is_int() to check that a form field contains a numeric value. You can "type cast" the form field value into an integer ecplicitly:
$numfield = (int) $formfield;
but this may not be your best solution. When doing the conversion, you may not get what you want. The conversion stops evaluating at the first non numeric character; ie:
'256' casts to 256
'123.45' casts to 123
but
$789 casts to 0
This if fine for making sure only numbers get into your database, but does not give your program or your users any feedback that what they entered (and what ultimately was processed) was what they intended.
I have always used regular expressions to verify the types of data entered into form fields. The is_int() function looked like an enticing short cut when I saw your example, but I guess we will have to stick to the tried-and-true ereg().
-- Rich Rijnders
-- Irvine, CA US