本文整理匯總了PHP中WPSC_Countries::get_currency方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPSC_Countries::get_currency方法的具體用法?PHP WPSC_Countries::get_currency怎麽用?PHP WPSC_Countries::get_currency使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WPSC_Countries
的用法示例。
在下文中一共展示了WPSC_Countries::get_currency方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Create a WPSC_Currency object
*
* @access public
*
* @since 3.8.14
*
* @param string $code this currency's code, like "USD" for a U.S.A dollar, or "EUR" for a euro
* @param string $symbol the text symbol for this currency, like "$"
* @param string $symbol_html the HTML representation of the symbol, like "$"
* @param string $name the currency name, like "US Dollar" or "Euro"
*
* @return void
*/
public function __construct($code, $symbol = null, $symbol_html = null, $name = null)
{
// if all parameters are specified we are trying to make a new currency object
if (!empty($code) && ($symbol != null || $symbol_html != null || $name != null)) {
// Create a new currency object
$this->code = $code;
$this->symbol = $symbol;
$this->symbol_html = $symbol_html;
$this->name = $name;
} else {
// if only code is specified the constructor is typing to get the information about an existing currency
$wpsc_currency = WPSC_Countries::get_currency($code);
$this->code = $wpsc_currency->code;
$this->symbol = $wpsc_currency->symbol;
$this->symbol_html = $wpsc_currency->symbol_html;
$this->name = $wpsc_currency->name;
}
}