如何解析PHP中的long值? [英] How to parse long value in php?
问题描述
需要类似intVal()的名称,但需要更大的数字,例如:100001416147426.
Need something like intVal() but for bigger numbers, for example: 100001416147426.
php中是否有类似这样的功能?找不到.
Is there a function like this in php? Can't find it.
推荐答案
您应使用 BC数学,它可以通过PHP设计为任意大小的数字.
You should use BC Math, it is designed to numbers of any size with PHP.
BC Math扩展提供了
在PHP文档站点上,有的小代码示例 >查尔斯舍入一个长数字! On the PHP documentation site there is a small code example by Charles to round a long number! 这篇关于如何解析PHP中的long值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!bcadd
添加两个任意精度数字bccomp
—比较两个任意精度数字bcsqrt
获取任意精度数的平方根
bcadd
Add two arbitrary precision numbersbccomp
— Compare two arbitrary precision numbersbcsqrt
Get the square root of an arbitrary precision number