shop-php/extend/Fastknife/Utils/MathUtils.php
2023-11-02 15:06:17 +08:00

16 lines
259 B
PHP

<?php
namespace Fastknife\Utils;
class MathUtils
{
/**
* 获取平均值
* @param array $array
* @return int
*/
public static function avg(array $array): int
{
return intval(array_sum($array) / count($array));
}
}