mazedlx / median
Super simple median calculation
1.2
2017-04-30 14:44 UTC
Requires
- phpspec/phpspec: ^3.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-16 07:05:51 UTC
README
median
Super simple PHP library for getting the median of array values (can also calc the average of the array's elements).
Installation and Usage
composer install mazedlx/median
$arrayOfValues = [1, 2, 5, 1000, 7] $m = new Median($arrayOfValues); $avg = $m->average(); // $avg == 203 $median = $m->median(); // $median == 5