PHP round to integer

后端 未结 6 444
再見小時候
再見小時候 2021-01-07 22:54

I want to round a number and I need a proper integer because I want to use it as an array key. The first \"solution\" that comes to mind is:

$key = (int)roun         


        
6条回答
  •  春和景丽
    2021-01-07 23:50

    Integers stored within floats are always accurate, up to around 253, which is much more than can be stored in an int anyway. I am worrying over nothing.

提交回复
热议问题