in PHP there is no strict variable types: every string can be an integer and every integer can be a string.
eg. if you have a string like "45asda23" and use it as an integer, you can, php will convert it to 45.
So what exactly trying to do with this code? In other words when you want your script to return "integer" result?
if you want to return integer when there is no chars in the string except a number, you can use this:
PHP Code:
if ((string)($userinfo[table])!=(int)($userinfo[table]))
{
echo "String<br>";
}
else
{
echo "Integer<br>";
}
or try "is_numeric" :
PHP Code:
if (is_numeric($userinfo[table]))
{
echo "Integer<br>";
}
else
{
echo "String<br>";
}
is_int checks the variable type only, not the context of variable..
Regard,
Logician