一維數組求平均值
function median($a) {
// Work your magic here. Make sure you're calculating the median, NOT the mean!
return array_sum($a)/count($a);
}