Possible Duplicates:
Fastest way to convert string to integer in PHP
PHP: Is there any particular difference between intval and (int)?
Is (int)$var same as intval($var) ?
Apparently they both do the same thing.
Is there any situation in which they would return different results?
(int)would seem to be a bit faster thanintval, as you don’t have the overhead of a function call.intvalalso allows you to set an optional base to convert to, which might be useful: