Before using the above, answer what your exact requirement is, see the example below.
$val = 252.587254564; echo (int)$val; //252 echo round($val, 0); //253 echo ceil($val); //253 $val = 1234567890123456789.512345; echo (int)$val; //1234567890123456768 echo round($val, 0);//1.2345678901235E+18 echo ceil($val); //1.2345678901235E+18 $val = 123456789012345678912.512345; echo (int)$val; //-5670419503621177344 echo round($val, 0);//1.2345678901235E+20 echo ceil($val); //1.2345678901235E+20
Nanhe kumar
source share