What potential issues can arise when using number_format() in PHP for formatting currency values?

Using number_format() in PHP for formatting currency values can lead to potential issues with the decimal separator and thousands separator, especially when working with different locales. To ensure proper formatting for currency values, it's recommended to use the NumberFormatter class in PHP, which provides more flexibility and support for different locales.

$amount = 1234.56;
$locale = 'en_US';
$fmt = new NumberFormatter($locale, NumberFormatter::CURRENCY);
echo $fmt->formatCurrency($amount, 'USD');