median.php
Table of Contents
Functions
- median() : float
- Computes the median (middle value) of a list of numbers.
Functions
median()
Computes the median (middle value) of a list of numbers.
median(array<int, int|float> $values) : float
The values are sorted numerically. For an odd number of values the middle one is returned ; for an even number, the average of the two central values is returned.
Parameters
- $values : array<int, int|float>
-
A non-empty list of numeric values.
Tags
Return values
float —The median of the values.