// 比例计算
function ratio($a, $b) {
$_a = $a;
$_b = $b;
while ($_b != 0) {
$remainder = $_a % $_b;
$_a = $_b;
$_b = $remainder;
}
$gcd = abs($_a);
return ($a / $gcd) . ':' . ($b / $gcd);
}
网友评论