PHP国家代码到HTML货币符号列表
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP国家代码到HTML货币符号列表相关的知识,希望对你有一定的参考价值。
This took me a while to create so thought I would share. Can be used with <a href="http://www.textfixer.com/resources/country-dropdowns.php">html dropdown lists</a>.
function country_currency( $amount = 0 ) { $bc = ''; // Set this to your country $currency_before = ''; $currency_after = ''; if( $bc == 'GB' || $bc == 'IE' || $bc == 'CY' ) $currency_before = '£'; if( $bc == 'AT' || $bc == 'BE' || $bc == 'FI' || $bc == 'FR' || $bc == 'DE' || $bc == 'GR' || $bc == 'GP' || $bc == 'IT' || $bc == 'LU' || $bc == 'NL' || $bc == 'PT' || $bc == 'SI' || $bc == 'ES') $currency_before = '€'; if( $bc == 'BR' ) $currency_before = 'R$'; if( $bc == 'CN' || $bc == 'JP' ) $currency_before = '¥'; if( $bc == 'CR' ) $currency_before = '¢'; if( $bc == 'HR' ) $currency_after = ' kn'; if( $bc == 'CZ' ) $currency_after = ' kc'; if( $bc == 'DK' ) $currency_before = 'DKK '; if( $bc == 'EE' ) $currency_after = ' EEK'; if( $bc == 'HK' ) $currency_before = 'HK$'; if( $bc == 'HU' ) $currency_after = ' Ft'; if( $bc == 'IS' || $bc == 'SE' ) $currency_after = ' kr'; if( $bc == 'IN' ) $currency_before = 'Rs. '; if( $bc == 'ID' ) $currency_before = 'Rp. '; if( $bc == 'IL' ) $currency_after = ' NIS'; if( $bc == 'LV' ) $currency_before = 'Ls '; if( $bc == 'LT' ) $currency_after = ' Lt'; if( $bc == 'MY' ) $currency_before = 'RM'; if( $bc == 'MT' ) $currency_before = 'Lm'; if( $bc == 'NO' ) $currency_before = 'kr '; if( $bc == 'PH' ) $currency_before = 'PHP'; if( $bc == 'PL' ) $currency_after = ' z'; if( $bc == 'RO' ) $currency_after = ' lei'; if( $bc == 'RU' ) $currency_before = 'RUB'; if( $bc == 'SK' ) $currency_after = ' Sk'; if( $bc == 'ZA' ) $currency_before = 'R '; if( $bc == 'KR' ) $currency_before = 'W'; if( $bc == 'CH' ) $currency_before = 'SFr. '; if( $bc == 'SY' ) $currency_after = ' SYP'; if( $bc == 'TH' ) $currency_after = ' Bt'; if( $bc == 'TT' ) $currency_before = 'TT$'; if( $bc == 'TR' ) $currency_after = ' TL'; if( $bc == 'AE' ) $currency_before = 'Dhs. '; if( $bc == 'VE' ) $currency_before = 'Bs. '; if( $currency_before == '' && $currency_after == '' ) $currency_before = '$'; }
以上是关于PHP国家代码到HTML货币符号列表的主要内容,如果未能解决你的问题,请参考以下文章
sql 具有iso代码,拨号代码,货币名称,货币符号和货币代码的国家/地区列表
text SQL中具有货币(ISO代码和符号)格式的国家/地区列表。