How can PHP be used to format currency values with thousands separators and no decimals?

To format currency values with thousands separators and no decimals in PHP, you can use the number_format() function. This function allows you to specify the number of decimal places, thousands separator, and decimal separator. By setting the decimal places to 0, you can achieve the desired format for currency values.

$amount = 1234567.89;
$formatted_amount = number_format($amount, 0, '.', ',');
echo $formatted_amount; // Output: 1,234,568