Hi,
I thinks it depends on the very specific task.
First approach: using is_int($your_value)
Problem: this will not recognize anything that consists of numbers only but has been assigned as a string, e.g. is_int(123) would return true while is_int('123') would return false. Therefore it won't get you far if you want to validate e.g. input a user has submitted.
Second approach: using intval($your_value)
Again, there may be some problem remaining: intval() ignores trailing nom-numerical characters, i.e. 1a would be treated same as integer 1.
If above techniques are not sufficiently precise for your purposes it might make sense to investigate the value string-based, e.g. ereg("[0-9]+$", $your_value) or
ereg("-?[0-9]+$", $your_value).
This would make absolute sure it only consists of digits from 0-9 with no letters, dots or whatever (use the latter version to allow negative integers as well).
I hope this is of any help...