At 05:55 PM 8/29/02 , JohnP wrote:
>Ok I looked at all the math functions for PHP but saw no way of returning 
>the average of a set of numbers - I plan on using this for a rating system 
>- any help?

Nope - you'll have to 'roll your own' by looping though the set, or (if you 
have version >= 4.0.5) you can use array_reduce() in conjunction with the 
count() function.

If these values are coming from a database, most databases have aggregate 
functions to do sums, averages, etc.


| Steve Edberg                                      [EMAIL PROTECTED] |
| Database/Programming/SysAdmin                            (530)754-9127 |
| University of California, Davis    |
+---------------------- Gort, Klaatu barada nikto! ----------------------+

Reply via email to