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
For My Case, I have to make whole number by float or decimal type number. By these way i solved my problem. Hope It works For You.
$value1 = "46.2";
$value2 = "46.8";
// If we print by round()
echo round( $value1 ); //return float 46.0
echo round( $value2 ); //return float 47.0
// To Get the integer value
echo intval(round( $value1 )); // return int 46
echo intval(round( $value2 )); // return int 47