當前位置: 首頁>>代碼示例>>PHP>>正文


PHP URLify::regex方法代碼示例

本文整理匯總了PHP中URLify::regex方法的典型用法代碼示例。如果您正苦於以下問題:PHP URLify::regex方法的具體用法?PHP URLify::regex怎麽用?PHP URLify::regex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在URLify的用法示例。


在下文中一共展示了URLify::regex方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /**
  * Initializes the character map.
  */
 private static function init($language = "")
 {
     if (count(self::$map) > 0 && ($language == "" || $language == self::$language)) {
         return;
     }
     /* Is a specific map associated with $language ? */
     if (isset(self::$maps[$language]) && is_array(self::$maps[$language])) {
         /* Move this map to end. This means it will have priority over others */
         $m = self::$maps[$language];
         unset(self::$maps[$language]);
         self::$maps[$language] = $m;
         /* Reset static vars */
         self::$language = $language;
         self::$map = array();
         self::$chars = '';
         self::$regex = '';
     }
     foreach (self::$maps as $map) {
         foreach ($map as $orig => $conv) {
             self::$map[$orig] = $conv;
             self::$chars .= $orig;
         }
     }
     self::$regex = '/[' . self::$chars . ']/u';
 }
開發者ID:ilosada,項目名稱:chamilo-lms-icpna,代碼行數:28,代碼來源:URLify.php

示例2: init

 /**
  * Initializes the character map.
  */
 private static function init()
 {
     if (count(self::$map) > 0) {
         return;
     }
     foreach (self::$maps as $map) {
         foreach ($map as $orig => $conv) {
             self::$map[$orig] = $conv;
             self::$chars .= $orig;
         }
     }
     self::$regex = '/[' . self::$chars . ']/u';
 }
開發者ID:nWidart,項目名稱:Alys-Google-Maps-Organiser,代碼行數:16,代碼來源:URLify.php

示例3: init

 /**
  * Initializes the character map.
  *
  * @param string $language
  *
  * @return bool
  */
 private static function init($language = 'de')
 {
     // check if lang is set
     if (!$language) {
         return false;
     }
     // check if we already created the regex for this lang
     if (count(self::$map) > 0 && $language == self::$language) {
         return true;
     }
     // is a specific map associated with $language?
     if (isset(self::$maps[$language]) && is_array(self::$maps[$language])) {
         // move this map to end. This means it will have priority over others
         $m = self::$maps[$language];
         unset(self::$maps[$language]);
         self::$maps[$language] = $m;
     }
     // reset static vars
     self::$language = $language;
     self::$map = array();
     self::$chars = '';
     foreach (self::$maps as $map) {
         foreach ($map as $orig => $conv) {
             self::$map[$orig] = $conv;
             self::$chars .= $orig;
         }
     }
     self::$regex = '/[' . self::$chars . ']/u';
     return true;
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:37,代碼來源:URLify.php


注:本文中的URLify::regex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。