rugzo Posted August 26, 2009 Share Posted August 26, 2009 Hi all, i couldn't find expression for average. There are many of them like sum(array) max(array) but couldn't find something like avg(array) ? Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted August 26, 2009 Share Posted August 26, 2009 Simple math, asuuming by average you mean mean $average = array_sum($array) / count($array); Quote Link to comment Share on other sites More sharing options...
waterssaz Posted August 26, 2009 Share Posted August 26, 2009 function average($array) { return array_sum($array) / count($array); } Works out the mean. Quote Link to comment Share on other sites More sharing options...
rugzo Posted August 26, 2009 Author Share Posted August 26, 2009 thanks... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.