当前位置:Gxlcms > PHP教程 > PHPstring函数小结

PHPstring函数小结

时间:2021-07-01 10:21:17 帮助过:2人阅读

PHP string函数总结

PHP string函数总结

?

==================================

ceil、floor、round、/、%

?

float ceil ( float $value )向上去整(进一)

??? cout(1.8)=>2
??? cout(-1.8)=>2-1


float floor ( float $value )向下去整(舍去)

??? floor(1.8)=>1

??? floor(-1.8)=>-2


round对浮点数进行四舍五入

float round ( float $val [, int $precision ] )

??? echo? round ( 1.95583 ,? 2 );?? //?1.96
??? echo? round ( 1241757 ,?- 3 );? //?1242000

=================================


人气教程排行