Yeah Zudo, you could do that....
You could put it all into a function too, to make it easer to call later:
<?
$var1 = 23;
$var2 = 7;
function divideme($var1, $var2){
global $r, $whole;
$r = $var1%$var2;
$var1 = $var1 - $r;
$whole = $var1/$var2;
return $r; $whole;
}
divideme($var1, $var2);
echo $var1."/".$var2."=";
echo $whole."R".$r;
// Outputs 23/7=3R2
?>
Of course, the numbers get screwed up if $var1 is smaller than $var2, so you would want to build in some error checking to make sure $var1 is larger than $var2. (Or you could just manipulate the function to account for this, and do the proper math to reflect it.)