<?php$rs[sum] = '165'; //总数$rs[row] = '43'; //单个数echo round($rs[row]/$rs[sum]*100,2)."%<br />";echo round($rs[row]/$rs[sum]*100)."%";?>
这样会输出:
26.06%
26%
<?php$rs[sum] = '165'; //总数$rs[row] = '43'; //单个数echo round($rs[row]/$rs[sum]*100,2)."%<br />";echo round($rs[row]/$rs[sum]*100)."%";?>
这样会输出:
26.06%
26%