Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1.  
  2. /*  calculates a fragzone game rating from 0 to 100 depending on a 1-5 star review system
  3.     @ input: an array of review values from 0-5
  4.     @ output: a value from 0 to 100
  5. */
  6.  
  7. function calc_fragzone_game_score($array_of_reviews)
  8. {
  9.     $total = 0;
  10.     foreach ($array_of_reviews as $value)
  11.     {
  12.         $total += $value * 20;
  13.     }
  14.     return $total/count($array_of_reviews);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement