Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* calculates a fragzone game rating from 0 to 100 depending on a 0-5 star review system
- @ input: an array of review values from 0-5
- @ output: a value from 0 to 100
- */
- function calc_fragzone_game_score($array_of_reviews)
- {
- $total = 0;
- foreach ($array_of_reviews as $value)
- {
- $total += $value * 20;
- }
- return $total/count($array_of_reviews);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement