本文整理匯總了PHP中Shopp::array_search_deep方法的典型用法代碼示例。如果您正苦於以下問題:PHP Shopp::array_search_deep方法的具體用法?PHP Shopp::array_search_deep怎麽用?PHP Shopp::array_search_deep使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shopp
的用法示例。
在下文中一共展示了Shopp::array_search_deep方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: region
/**
* Finds the translated region name for a specific region index
*
* @since 1.1
* @version 1.4
*
* @param type $var Description...
* @return string The translated region name
**/
public static function region($country, $index = false)
{
$regions = self::regions(true);
$region = Shopp::array_search_deep($country, $regions);
if (empty($region)) {
return false;
}
if (false !== $index) {
return array_search($region, array_keys($regions));
}
return $region;
}
示例2: __construct
public function __construct($code, $country)
{
$currencies = $this->currencies();
if (!isset($currencies[$code])) {
return false;
}
$this->code = $code;
if (count($currencies[$code]) > 1) {
$json_format = Shopp::array_search_deep($country, $currencies[$code]);
} else {
$json_format = key($currencies[$code]);
}
$format = json_decode($json_format);
list($this->position, $this->symbol, $this->precision, $this->decimals, $this->thousands, $this->grouping) = (array) $format;
}
示例3: lookup
public function lookup($code = false)
{
$countries = ShoppLookup::countries();
if (!isset($countries[$code])) {
return false;
}
$this->code = $code;
$this->name = $countries[$code];
// Currency
$currencies = (include $this->data('currencies.php'));
$currency = Shopp::array_search_deep($code, $currencies);
$this->Currency = new ShoppLocaleCurrency($currency);
// Region
$regions = (include $this->data('regions.php'));
$this->region = Shopp::array_search_deep($code, $regions);
// Addressing
$addrs = (include $this->data('addressing.php'));
if (isset($addrs[$code])) {
$this->addressing = $addrs[$code];
} else {
$this->addressing = SHOPP_DEFAULT_ADDRESSING;
}
// Units
$imperial = array_flip(ShoppLookup::imperial_units());
if (isset($imperial[$code])) {
$this->units = 'imperial';
}
}