Page 1 of 1

Dropping remainder when dividing

Posted: Sat Oct 02, 2010 11:09 am
by rufee
Hello
I need help on how to divide two integer numbers and get an integer answer (drop the remainder)
Ive been searching all over php.net and google but could find an answer
I need to get something like this:
14 / 11 = 1
40 / 16 = 2
you get the idea

Re: Dropping remainder when dividing

Posted: Sat Oct 02, 2010 11:22 am
by requinix
You can't do it in the first step (division) but you can do it with a second.

Re: Dropping remainder when dividing

Posted: Sat Oct 02, 2010 2:22 pm
by DigitalMind

Code: Select all

echo (int)(14 / 11);