Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
An array of currency symbols as HTML entities
<?php
$currency_symbols = array(
'AED' => '&#1583;.&#1573;', // ?
'AFN' => '&#65;&#102;',
'ALL' => '&#76;&#101;&#107;',
'AMD' => '',
'ANG' => '&#402;',
'AOA' => '&#75;&#122;', // ?
'ARS' => '&#36;',
'AUD' => '&#36;',
'AWG' => '&#402;',
'AZN' => '&#1084;&#1072;&#1085;',
'BAM' => '&#75;&#77;',
'BBD' => '&#36;',
'BDT' => '&#2547;', // ?
'BGN' => '&#1083;&#1074;',
'BHD' => '.&#1583;.&#1576;', // ?
'BIF' => '&#70;&#66;&#117;', // ?
'BMD' => '&#36;',
'BND' => '&#36;',
'BOB' => '&#36;&#98;',
'BRL' => '&#82;&#36;',
'BSD' => '&#36;',
'BTN' => '&#78;&#117;&#46;', // ?
'BWP' => '&#80;',
'BYR' => '&#112;&#46;',
'BZD' => '&#66;&#90;&#36;',
'CAD' => '&#36;',
'CDF' => '&#70;&#67;',
'CHF' => '&#67;&#72;&#70;',
'CLF' => '', // ?
'CLP' => '&#36;',
'CNY' => '&#165;',
'COP' => '&#36;',
'CRC' => '&#8353;',
'CUP' => '&#8396;',
'CVE' => '&#36;', // ?
'CZK' => '&#75;&#269;',
'DJF' => '&#70;&#100;&#106;', // ?
'DKK' => '&#107;&#114;',
'DOP' => '&#82;&#68;&#36;',
'DZD' => '&#1583;&#1580;', // ?
'EGP' => '&#163;',
'ETB' => '&#66;&#114;',
'EUR' => '&#8364;',
'FJD' => '&#36;',
'FKP' => '&#163;',
'GBP' => '&#163;',
'GEL' => '&#4314;', // ?
'GHS' => '&#162;',
'GIP' => '&#163;',
'GMD' => '&#68;', // ?
'GNF' => '&#70;&#71;', // ?
'GTQ' => '&#81;',
'GYD' => '&#36;',
'HKD' => '&#36;',
'HNL' => '&#76;',
'HRK' => '&#107;&#110;',
'HTG' => '&#71;', // ?
'HUF' => '&#70;&#116;',
'IDR' => '&#82;&#112;',
'ILS' => '&#8362;',
'INR' => '&#8377;',
'IQD' => '&#1593;.&#1583;', // ?
'IRR' => '&#65020;',
'ISK' => '&#107;&#114;',
'JEP' => '&#163;',
'JMD' => '&#74;&#36;',
'JOD' => '&#74;&#68;', // ?
'JPY' => '&#165;',
'KES' => '&#75;&#83;&#104;', // ?
'KGS' => '&#1083;&#1074;',
'KHR' => '&#6107;',
'KMF' => '&#67;&#70;', // ?
'KPW' => '&#8361;',
'KRW' => '&#8361;',
'KWD' => '&#1583;.&#1603;', // ?
'KYD' => '&#36;',
'KZT' => '&#1083;&#1074;',
'LAK' => '&#8365;',
'LBP' => '&#163;',
'LKR' => '&#8360;',
'LRD' => '&#36;',
'LSL' => '&#76;', // ?
'LTL' => '&#76;&#116;',
'LVL' => '&#76;&#115;',
'LYD' => '&#1604;.&#1583;', // ?
'MAD' => '&#1583;.&#1605;.', //?
'MDL' => '&#76;',
'MGA' => '&#65;&#114;', // ?
'MKD' => '&#1076;&#1077;&#1085;',
'MMK' => '&#75;',
'MNT' => '&#8366;',
'MOP' => '&#77;&#79;&#80;&#36;', // ?
'MRO' => '&#85;&#77;', // ?
'MUR' => '&#8360;', // ?
'MVR' => '.&#1923;', // ?
'MWK' => '&#77;&#75;',
'MXN' => '&#36;',
'MYR' => '&#82;&#77;',
'MZN' => '&#77;&#84;',
'NAD' => '&#36;',
'NGN' => '&#8358;',
'NIO' => '&#67;&#36;',
'NOK' => '&#107;&#114;',
'NPR' => '&#8360;',
'NZD' => '&#36;',
'OMR' => '&#65020;',
'PAB' => '&#66;&#47;&#46;',
'PEN' => '&#83;&#47;&#46;',
'PGK' => '&#75;', // ?
'PHP' => '&#8369;',
'PKR' => '&#8360;',
'PLN' => '&#122;&#322;',
'PYG' => '&#71;&#115;',
'QAR' => '&#65020;',
'RON' => '&#108;&#101;&#105;',
'RSD' => '&#1044;&#1080;&#1085;&#46;',
'RUB' => '&#1088;&#1091;&#1073;',
'RWF' => '&#1585;.&#1587;',
'SAR' => '&#65020;',
'SBD' => '&#36;',
'SCR' => '&#8360;',
'SDG' => '&#163;', // ?
'SEK' => '&#107;&#114;',
'SGD' => '&#36;',
'SHP' => '&#163;',
'SLL' => '&#76;&#101;', // ?
'SOS' => '&#83;',
'SRD' => '&#36;',
'STD' => '&#68;&#98;', // ?
'SVC' => '&#36;',
'SYP' => '&#163;',
'SZL' => '&#76;', // ?
'THB' => '&#3647;',
'TJS' => '&#84;&#74;&#83;', // ? TJS (guess)
'TMT' => '&#109;',
'TND' => '&#1583;.&#1578;',
'TOP' => '&#84;&#36;',
'TRY' => '&#8356;', // New Turkey Lira (old symbol used)
'TTD' => '&#36;',
'TWD' => '&#78;&#84;&#36;',
'TZS' => '',
'UAH' => '&#8372;',
'UGX' => '&#85;&#83;&#104;',
'USD' => '&#36;',
'UYU' => '&#36;&#85;',
'UZS' => '&#1083;&#1074;',
'VEF' => '&#66;&#115;',
'VND' => '&#8363;',
'VUV' => '&#86;&#84;',
'WST' => '&#87;&#83;&#36;',
'XAF' => '&#70;&#67;&#70;&#65;',
'XCD' => '&#36;',
'XDR' => '',
'XOF' => '',
'XPF' => '&#70;',
'YER' => '&#65020;',
'ZAR' => '&#82;',
'ZMK' => '&#90;&#75;', // ?
'ZWL' => '&#90;&#36;',
);
@hyyan

This comment has been minimized.

Copy link

@hyyan hyyan commented Jul 18, 2015

Thank you for sharing 😄

@maherelgamil

This comment has been minimized.

Copy link

@maherelgamil maherelgamil commented Jul 31, 2015

thanks :)

@danilor

This comment has been minimized.

Copy link

@danilor danilor commented Nov 24, 2015

Thank you!

@Neeraj05

This comment has been minimized.

Copy link

@Neeraj05 Neeraj05 commented Nov 27, 2015

Thank you, this is awesome!!!!!

@sathi081289

This comment has been minimized.

Copy link

@sathi081289 sathi081289 commented Mar 7, 2016

its great, but these currency symbols not showing properly in pdf.can anyone help me

@adamth0

This comment has been minimized.

Copy link

@adamth0 adamth0 commented Mar 31, 2016

The currency symbol for the Azerbaijani Manat is now available, and is &#8380;

@cybersholt

This comment has been minimized.

Copy link

@cybersholt cybersholt commented Apr 4, 2016

Thanks!

@mernstackman

This comment has been minimized.

Copy link

@mernstackman mernstackman commented May 2, 2016

Thank you..., very useful :) 👍

@gl2748

This comment has been minimized.

Copy link

@gl2748 gl2748 commented May 18, 2016

Thanks!

@damko

This comment has been minimized.

Copy link

@damko damko commented Jun 5, 2016

great!

@Blair2004

This comment has been minimized.

Copy link

@Blair2004 Blair2004 commented Jun 9, 2016

Good Job

@edwinwong90

This comment has been minimized.

Copy link

@edwinwong90 edwinwong90 commented Jun 19, 2016

Great! thanks for sharing! 👍

@gsimonk

This comment has been minimized.

Copy link

@gsimonk gsimonk commented Jun 27, 2016

Thank you very much for sharing

@cdburgess

This comment has been minimized.

Copy link

@cdburgess cdburgess commented Jul 28, 2016

I think the Egyptian Pound (currently 'EGP' => '&#163;',) should be 'EGP' => 'E&#163;', [ E£ ]

@aboshooq

This comment has been minimized.

Copy link

@aboshooq aboshooq commented Aug 4, 2016

thanks, very helpful.

@karim-khan

This comment has been minimized.

Copy link

@karim-khan karim-khan commented Oct 25, 2016

Thank you for sharing and please add 'AMD' currency_symbol 'AMD' => ' ֏ '

@vishalgahlot

This comment has been minimized.

Copy link

@vishalgahlot vishalgahlot commented Dec 12, 2016

while sending value to db it;s not storing the symbol in right manner.
Like i want to store Rs , it's storing ₹

@despDev

This comment has been minimized.

Copy link

@despDev despDev commented Feb 16, 2017

KZT is wrong. Instead of 'лв' it should be '₸'

@GianvitoBono

This comment has been minimized.

Copy link

@GianvitoBono GianvitoBono commented May 25, 2017

Thank you very much for sharing

@tejasm-itpath

This comment has been minimized.

Copy link

@tejasm-itpath tejasm-itpath commented Aug 2, 2017

Thank You so much , You saved my time

@mainIine

This comment has been minimized.

Copy link

@mainIine mainIine commented Aug 16, 2017

Many thx! Saved me a lot of time.

@adsheff

This comment has been minimized.

Copy link

@adsheff adsheff commented Sep 14, 2017

This is the most useful thing on Github. Thank you!

@pptyasar

This comment has been minimized.

Copy link

@pptyasar pptyasar commented Sep 28, 2017

Thanks. Anyone how actually browser know this entities?

@uniconstructor

This comment has been minimized.

Copy link

@uniconstructor uniconstructor commented Nov 16, 2017

Here is js version if someone need it:

/**
 * @see https://gist.github.com/Gibbs/3920259
 *
 * @type {{AED: string, AFN: string, ALL: string, AMD: string, ANG: string, AOA: string, ARS: string, AUD: string, AWG: string, AZN: string, BAM: string, BBD: string, BDT: string, BGN: string, BHD: string, BIF: string, BMD: string, BND: string, BOB: string, BRL: string, BSD: string, BTN: string, BWP: string, BYR: string, BZD: string, CAD: string, CDF: string, CHF: string, CLF: string, CLP: string, CNY: string, COP: string, CRC: string, CUP: string, CVE: string, CZK: string, DJF: string, DKK: string, DOP: string, DZD: string, EGP: string, ETB: string, EUR: string, FJD: string, FKP: string, GBP: string, GEL: string, GHS: string, GIP: string, GMD: string, GNF: string, GTQ: string, GYD: string, HKD: string, HNL: string, HRK: string, HTG: string, HUF: string, IDR: string, ILS: string, INR: string, IQD: string, IRR: string, ISK: string, JEP: string, JMD: string, JOD: string, JPY: string, KES: string, KGS: string, KHR: string, KMF: string, KPW: string, KRW: string, KWD: string, KYD: string, KZT: string, LAK: string, LBP: string, LKR: string, LRD: string, LSL: string, LTL: string, LVL: string, LYD: string, MAD: string, MDL: string, MGA: string, MKD: string, MMK: string, MNT: string, MOP: string, MRO: string, MUR: string, MVR: string, MWK: string, MXN: string, MYR: string, MZN: string, NAD: string, NGN: string, NIO: string, NOK: string, NPR: string, NZD: string, OMR: string, PAB: string, PEN: string, PGK: string, PHP: string, PKR: string, PLN: string, PYG: string, QAR: string, RON: string, RSD: string, RUB: string, RWF: string, SAR: string, SBD: string, SCR: string, SDG: string, SEK: string, SGD: string, SHP: string, SLL: string, SOS: string, SRD: string, STD: string, SVC: string, SYP: string, SZL: string, THB: string, TJS: string, TMT: string, TND: string, TOP: string, TRY: string, TTD: string, TWD: string, TZS: string, UAH: string, UGX: string, USD: string, UYU: string, UZS: string, VEF: string, VND: string, VUV: string, WST: string, XAF: string, XCD: string, XDR: string, XOF: string, XPF: string, YER: string, ZAR: string, ZMK: string, ZWL: string}}
 */
module.exports = {
    'AED' : '&#1583;.&#1573;', // ?
    'AFN' : '&#65;&#102;',
    'ALL' : '&#76;&#101;&#107;',
    'AMD' : '',
    'ANG' : '&#402;',
    'AOA' : '&#75;&#122;', // ?
    'ARS' : '&#36;',
    'AUD' : '&#36;',
    'AWG' : '&#402;',
    'AZN' : '&#1084;&#1072;&#1085;',
    'BAM' : '&#75;&#77;',
    'BBD' : '&#36;',
    'BDT' : '&#2547;', // ?
    'BGN' : '&#1083;&#1074;',
    'BHD' : '.&#1583;.&#1576;', // ?
    'BIF' : '&#70;&#66;&#117;', // ?
    'BMD' : '&#36;',
    'BND' : '&#36;',
    'BOB' : '&#36;&#98;',
    'BRL' : '&#82;&#36;',
    'BSD' : '&#36;',
    'BTN' : '&#78;&#117;&#46;', // ?
    'BWP' : '&#80;',
    'BYR' : '&#112;&#46;',
    'BZD' : '&#66;&#90;&#36;',
    'CAD' : '&#36;',
    'CDF' : '&#70;&#67;',
    'CHF' : '&#67;&#72;&#70;',
    'CLF' : '', // ?
    'CLP' : '&#36;',
    'CNY' : '&#165;',
    'COP' : '&#36;',
    'CRC' : '&#8353;',
    'CUP' : '&#8396;',
    'CVE' : '&#36;', // ?
    'CZK' : '&#75;&#269;',
    'DJF' : '&#70;&#100;&#106;', // ?
    'DKK' : '&#107;&#114;',
    'DOP' : '&#82;&#68;&#36;',
    'DZD' : '&#1583;&#1580;', // ?
    'EGP' : '&#163;',
    'ETB' : '&#66;&#114;',
    'EUR' : '&#8364;',
    'FJD' : '&#36;',
    'FKP' : '&#163;',
    'GBP' : '&#163;',
    'GEL' : '&#4314;', // ?
    'GHS' : '&#162;',
    'GIP' : '&#163;',
    'GMD' : '&#68;', // ?
    'GNF' : '&#70;&#71;', // ?
    'GTQ' : '&#81;',
    'GYD' : '&#36;',
    'HKD' : '&#36;',
    'HNL' : '&#76;',
    'HRK' : '&#107;&#110;',
    'HTG' : '&#71;', // ?
    'HUF' : '&#70;&#116;',
    'IDR' : '&#82;&#112;',
    'ILS' : '&#8362;',
    'INR' : '&#8377;',
    'IQD' : '&#1593;.&#1583;', // ?
    'IRR' : '&#65020;',
    'ISK' : '&#107;&#114;',
    'JEP' : '&#163;',
    'JMD' : '&#74;&#36;',
    'JOD' : '&#74;&#68;', // ?
    'JPY' : '&#165;',
    'KES' : '&#75;&#83;&#104;', // ?
    'KGS' : '&#1083;&#1074;',
    'KHR' : '&#6107;',
    'KMF' : '&#67;&#70;', // ?
    'KPW' : '&#8361;',
    'KRW' : '&#8361;',
    'KWD' : '&#1583;.&#1603;', // ?
    'KYD' : '&#36;',
    'KZT' : '&#1083;&#1074;',
    'LAK' : '&#8365;',
    'LBP' : '&#163;',
    'LKR' : '&#8360;',
    'LRD' : '&#36;',
    'LSL' : '&#76;', // ?
    'LTL' : '&#76;&#116;',
    'LVL' : '&#76;&#115;',
    'LYD' : '&#1604;.&#1583;', // ?
    'MAD' : '&#1583;.&#1605;.', //?
    'MDL' : '&#76;',
    'MGA' : '&#65;&#114;', // ?
    'MKD' : '&#1076;&#1077;&#1085;',
    'MMK' : '&#75;',
    'MNT' : '&#8366;',
    'MOP' : '&#77;&#79;&#80;&#36;', // ?
    'MRO' : '&#85;&#77;', // ?
    'MUR' : '&#8360;', // ?
    'MVR' : '.&#1923;', // ?
    'MWK' : '&#77;&#75;',
    'MXN' : '&#36;',
    'MYR' : '&#82;&#77;',
    'MZN' : '&#77;&#84;',
    'NAD' : '&#36;',
    'NGN' : '&#8358;',
    'NIO' : '&#67;&#36;',
    'NOK' : '&#107;&#114;',
    'NPR' : '&#8360;',
    'NZD' : '&#36;',
    'OMR' : '&#65020;',
    'PAB' : '&#66;&#47;&#46;',
    'PEN' : '&#83;&#47;&#46;',
    'PGK' : '&#75;', // ?
    'PHP' : '&#8369;',
    'PKR' : '&#8360;',
    'PLN' : '&#122;&#322;',
    'PYG' : '&#71;&#115;',
    'QAR' : '&#65020;',
    'RON' : '&#108;&#101;&#105;',
    'RSD' : '&#1044;&#1080;&#1085;&#46;',
    'RUB' : '&#8381;',
    'RWF' : '&#1585;.&#1587;',
    'SAR' : '&#65020;',
    'SBD' : '&#36;',
    'SCR' : '&#8360;',
    'SDG' : '&#163;', // ?
    'SEK' : '&#107;&#114;',
    'SGD' : '&#36;',
    'SHP' : '&#163;',
    'SLL' : '&#76;&#101;', // ?
    'SOS' : '&#83;',
    'SRD' : '&#36;',
    'STD' : '&#68;&#98;', // ?
    'SVC' : '&#36;',
    'SYP' : '&#163;',
    'SZL' : '&#76;', // ?
    'THB' : '&#3647;',
    'TJS' : '&#84;&#74;&#83;', // ? TJS (guess)
    'TMT' : '&#109;',
    'TND' : '&#1583;.&#1578;',
    'TOP' : '&#84;&#36;',
    'TRY' : '&#8356;', // New Turkey Lira (old symbol used)
    'TTD' : '&#36;',
    'TWD' : '&#78;&#84;&#36;',
    'TZS' : '',
    'UAH' : '&#8372;',
    'UGX' : '&#85;&#83;&#104;',
    'USD' : '&#36;',
    'UYU' : '&#36;&#85;',
    'UZS' : '&#1083;&#1074;',
    'VEF' : '&#66;&#115;',
    'VND' : '&#8363;',
    'VUV' : '&#86;&#84;',
    'WST' : '&#87;&#83;&#36;',
    'XAF' : '&#70;&#67;&#70;&#65;',
    'XCD' : '&#36;',
    'XDR' : '',
    'XOF' : '',
    'XPF' : '&#70;',
    'YER' : '&#65020;',
    'ZAR' : '&#82;',
    'ZMK' : '&#90;&#75;', // ?
    'ZWL' : '&#90;&#36;',
};
@uniconstructor

This comment has been minimized.

Copy link

@uniconstructor uniconstructor commented Nov 16, 2017

Alternatively, you can use this package: https://github.com/bengourley/currency-symbol-map
It works fine for mac and linux but has problems with windows.

@uniconstructor

This comment has been minimized.

Copy link

@uniconstructor uniconstructor commented Nov 16, 2017

RUB currency shoud be ₽

'RUB' => '&#8381;',
@dieppon

This comment has been minimized.

Copy link

@dieppon dieppon commented Aug 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment