当前位置: 首页>>代码示例>>PHP>>正文


PHP Shopp::array_search_deep方法代码示例

本文整理汇总了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;
 }
开发者ID:forthrobot,项目名称:inuvik,代码行数:21,代码来源:Lookup.php

示例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;
 }
开发者ID:forthrobot,项目名称:inuvik,代码行数:15,代码来源:Locale.php

示例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';
     }
 }
开发者ID:jonathandavis,项目名称:shopp,代码行数:28,代码来源:Locale.php


注:本文中的Shopp::array_search_deep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。