Rounding Numbers to the Nearest Integer in PHP


Round a number to the nearest integer using round().

Source Code

echo round(3.4); // Outputs: 3
echo round(3.5); // Outputs: 4
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments