本文整理汇总了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';
}
}