PHP string函数小结

WBOY
Release: 2016-06-13 13:02:28
Original
767 people have browsed it

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
=================================

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template