當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。