常用的math函数
<?php
//1.abs — 绝对值
echo abs(-77);
//ceil — 进一法取整
echo ceil(3.04);
//floor - 舍弃法取证
echo floor(3.14);
//round -四舍五入取整
echo round(3.54);
//max — 找出最大值
$maxNum = max(1,2,3,4,5,11116,54,656,67,67);
echo $maxNum;
$maxNum = max(array(45,452345,1111111112345,45454,));
echo $maxNum;
//min --找出最小值
$minNum = min(1,2,3,4,5,11116,54,656,67,67);
echo $minNum;
$minNum = min(array(45,452345,1111111112345,45454,));
echo $minNum;
//rand — 产生一个随机整数
echo rand(50,60);
//生成更好的随机数
echo mt_rand(50,60);
//pi 得到圆周率值
echo pi();
//常量取圆周率
echo M_PI;
//sqrt -- 平方根
echo sqrt(4);
//pow 指数表达式
echo pow(4,2);
?>