php使用NumberFormatter格式化货币
$amount = '12345.67'; $formatter = new NumberFormatter('en_GB', NumberFormatter::CURRENCY); echo 'UK: ' . $formatter->formatCurrency($amount, 'EUR') . PHP_EOL; $formatter = new NumberFormatter('de_DE', NumberFormatter::CURRENCY); echo 'DE: ' . $formatter->formatCurrency($amount, 'EUR') . PHP_EOL;