PHP Classes

PHP Get Currency Symbol: Get the symbol of any given currency

Recommend this page to a friend!
  Info   View files Documentation   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 157 This week: 1All time: 8,954 This week: 404Up
Version License PHP version Categories
currency-util 1.0.0MIT/X Consortium ...5PHP 5, Finances




This class can get the symbol of any given currency.

It can take as parameter of code of a given currency.

The class can return the symbol associated to that currency.

Innovation Award
PHP Programming Innovation award nominee
September 2019
Number 12
Each currency used in different countries to represent money has a symbol that is associated the currency which is used to make clear when a given money amount is displayed so other people can see prices or other values that represent money.

This class can return the symbols used to represent many currencies using pure PHP, thus not relying on the availability of any PHP extension for that purpose.

Manuel Lemos
Picture of Ogbemudia Osayawe
  Performance   Level  
Name: Ogbemudia Osayawe <contact>
Classes: 7 packages by
Country: Germany Germany
Age: 40
All time rank: 3016176 in Germany Germany
Week rank: 310 Up8 in Germany Germany Up
Innovation award
Innovation award
Nominee: 4x


php currency-util

A simple library to lookup the currency symbol for a given currency code.


composer req terdia/currency-util


Get symbol from currency code

use Currency\Util\CurrencySymbolUtil;

CurrencySymbolUtil::getSymbol('GBP') //=> ''
CurrencySymbolUtil::getSymbol('EUR') //=> '?'
CurrencySymbolUtil::getSymbol('USD') //=> '$'
CurrencySymbolUtil::getSymbol('NOT A VALID CODE') throw InvalidArgumentException

Get List of supported currency code

use Currency\Util\CurrencySymbolMapping;

// =>
 "USD" => "$",
 "GBP" => "",
 "EUR" => "?",


vendor/bin/phpunit tests


Feel free to contribute to this library.

  Files folder image Files  
File Role Description
Files folder imagesrc (2 files)
Files folder imagetests (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file CurrencySymbolMapping.php Class Class source
  Plain text file CurrencySymbolUtil.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file CurrencySymbolUtilTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:8,954
This week:404Up