Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 462 Bytes

README.md

File metadata and controls

21 lines (13 loc) · 462 Bytes

Build Status

median

Super simple PHP library for getting the median of array values (cn 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);

$avh = $m->average();
// $avh == 203

$median = $m->median();
// $median == 5