php get array average
snippet in php

php get array average

user7183

$myArray=[1,5,4,3];
$average = array_sum($myArray)/count($myArray);