How can PHP be used to round numbers to the nearest thousand?

To round numbers to the nearest thousand in PHP, you can divide the number by 1000, round it to the nearest whole number, and then multiply it back by 1000. This will effectively round the number to the nearest thousand.

$number = 4567;
$roundedNumber = round($number / 1000) * 1000;

echo $roundedNumber; // Output: 5000