mardi 13 octobre 2020

Get currency symbol in Laravel 8.x

I would like to get the currency symbol for an ISO-3 string in Laravel 8.x.

Example:

$iso_code = 'EUR';
$symbol = convertToSymbolFunction('EUR');

echo $symbol;

...and the $symbol would equal to:

'€'

I know that there is a native PHP NumberFormatter function, but that requires the locale of the user. I'm wondering if there's a simpler version or a library for Laravel that supports something like the above example.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire