Calculation for how many of X is in Y and the remainder
<p>Is there a better way of doing this in php - I'd have thought so but this is all I can think of.</p>

<pre><code>$x = 4
$y = 32

while ($y &gt; $x) { $y = $y-$x; } 
</code></pre>

<p>The final value of $y is what I'm after.</p>
