Question: how to calculate the percentage in php?
Answer: function get_percentage($total, $number)
if ( $total > 0 ) {
return round($number / ($total / 100),2);
} else {
return 0;
}
}