PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I round up a number?


If you wish to round up a number using PHP, then one option is to use the ceil function, as below:

<?php
$value 
25.01;
echo 
ceil($value);
?>


This will print 26.



More numbers PHP Questions

How do I force a value to be treated as a number?
How do I format a number with commas like a monetary value?
How do I generate a random number?
How do I round down a number?
How do I work out the remainder of a division?