How can older PHP versions handle rounding numbers to the nearest thousand?

In older PHP versions, rounding numbers to the nearest thousand can be achieved by dividing the number by 1000, rounding it to the nearest whole number, and then multiplying it back by 1000. This process effectively rounds the number to the nearest thousand.

$number = 4567;
$roundedNumber = round($number / 1000) * 1000;
echo $roundedNumber; // Output: 5000