if ($bottom) { $result = $top / $bottom; } else { $ result = 0; }