Advertisement
Guest User

Untitled

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