What is the function in PHP to round up a decimal number to the nearest whole number?

To round up a decimal number to the nearest whole number in PHP, you can use the ceil() function. This function returns the next highest integer value by rounding up the given decimal number. Simply pass the decimal number as an argument to the ceil() function to get the rounded up result.

$decimalNumber = 4.7;
$roundedNumber = ceil($decimalNumber);
echo $roundedNumber; // Output: 5