How do I perform integer division in PHP
PHP's division operator returns a floating point result from the division operator unless both operands are integers and they are evenly divisible (the result is an integer). I was recently working on Project Euler Problem 13 and needed to do integer division, something I haven't come across in PHP before.
Integer division in PHP is pretty straight forward. Casting the result as an integer will yield an integer. That is: