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