Dropping remainder when dividing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rufee
Forum Newbie
Posts: 10
Joined: Wed Dec 09, 2009 10:23 am

Dropping remainder when dividing

Post 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
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Dropping remainder when dividing

Post by requinix »

You can't do it in the first step (division) but you can do it with a second.
User avatar
DigitalMind
Forum Contributor
Posts: 152
Joined: Mon Sep 27, 2010 2:27 am
Location: Ukraine, Kharkov

Re: Dropping remainder when dividing

Post by DigitalMind »

Code: Select all

echo (int)(14 / 11);
Post Reply