Re: key arrays should be integers when they are not what's happening exactly?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jul 20, 2014 at 5:22 PM, Negin Nickparsa <nickparsa@xxxxxxxxx>
wrote:

> how PHP rounds the numbers in this case ?
>

It doesn't use the built-in round function but rather casts the floats to
int. You can achieve the same effect with the intval function and casting.

    > echo intval(1.5);
    1

    > echo (int) 1.5;
    1

Peace,
David

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux