/** * Get the symbol associated with a currency, optionally specified with '$currency_code' parameter. * * Will always return the symbol and can optionally also print the symbol. * * @param $currency_code, string, optional, the ISO 4217 Code of the currency for which you want the Symbol, default the currency code of this object * @param $echo bool, Optionally print the symbol before returning it. **/ public function get_currency_symbol($currency_code = '', $echo = false) { if (empty($currency_code)) { $currency_code = PayPal_Digital_Goods_Configuration::currency(); } switch ($currency_code) { case 'AUD': case 'CAD': case 'NZD': case 'SGD': case 'HKD': case 'TWD': case 'USD': $currency_symbol = '$'; break; case 'DKK': case 'NOK': case 'SEK': $currency_symbol = 'kr'; break; case 'EUR': $currency_symbol = '€'; break; case 'GBP': $currency_symbol = '£'; break; case 'JPY': $currency_symbol = '¥'; break; case 'CZK': $currency_symbol = 'Kč'; break; case 'HUF': $currency_symbol = 'Ft'; break; case 'PLN': $currency_symbol = 'zł'; break; case 'CHF': $currency_symbol = 'CHF'; break; } if ($echo) { echo $currency_symbol; } return $currency_symbol; }