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


PHP Sanitize::toXhtml方法代碼示例

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


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

示例1: get

 public static function get($strName, $strCategory = "global", $blnReturnError = true)
 {
     //*** Get a translation from the language file.
     $strReturn = $blnReturnError ? sprintf(self::$error, $strName, $strCategory) : "";
     if (isset(self::$languages[$strCategory][$strName])) {
         $strReturn = self::$languages[$strCategory][$strName];
     }
     //*** Output sanitisation?
     switch (self::$sanitizeType) {
         case "xhtml":
             if (class_exists("Bili\\Sanitize", true)) {
                 $strReturn = Sanitize::toXhtml($strReturn);
             }
             break;
         case "entities":
             if (class_exists("Bili\\Sanitize", true)) {
                 $strReturn = Sanitize::toEntities($strReturn);
             }
             break;
     }
     return $strReturn;
 }
開發者ID:rvanbaalen,項目名稱:bili,代碼行數:22,代碼來源:Language.php

示例2: renderNumber

 /**
  * Format a numeric value according to the language settings.
  *
  * @return string string representation of a numeric value
  */
 public static function renderNumber($fltValue, $intMaxDecimal = 2, $intMinDecimal = 2, $blnShowThousandSeparator = true)
 {
     $fltValue = floatval($fltValue);
     $intValue = floor($fltValue);
     for ($intDecimals = 0; $fltValue != round($fltValue, $intDecimals); $intDecimals++) {
         //*** Just counting.
     }
     if ($intDecimals <= $intMinDecimal) {
         $intMaxDecimal = $intMinDecimal;
     }
     $strDecimalPoint = Language::get("decimal_separator", "global", false);
     $strThousandSeparator = Language::get("thousands_separator", "global", false);
     if (empty($strDecimalPoint) || empty($strThousandSeparator)) {
         $arrLocaleInfo = localeconv();
         if (empty($strDecimalPoint) && isset($arrLocaleInfo["decimal_point"])) {
             $strDecimalPoint = $arrLocaleInfo["decimal_point"];
         }
         if (empty($strThousandSeparator) && isset($arrLocaleInfo["thousands_sep"])) {
             $strThousandSeparator = $arrLocaleInfo["thousands_sep"];
         }
     }
     $strThousandSeparator = $blnShowThousandSeparator ? $strThousandSeparator : "";
     $strReturn = number_format($fltValue, $intMaxDecimal, $strDecimalPoint, $strThousandSeparator);
     return Sanitize::toXhtml($strReturn);
 }
開發者ID:rvanbaalen,項目名稱:bili,代碼行數:30,代碼來源:Display.php


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