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


PHP utf8::init方法代碼示例

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


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

示例1: init

<?php

/*
* BtiTracker v1.5.1 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified). 
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2015 Btiteam.org
*/
require_once CLASS_PATH . 'class.String.php';
require_once CLASS_PATH . 'class.Memcached.php';
utf8::init();
class utf8
{
    const TRANSKEY = 'utf8::utf8_win_iso::translation_table';
    const NBSP = " ";
    // &nbsp; # Non-Breaking Space
    const TRIM_CHARLIST = ".. ..  ..� �� ";
    private static $trans_table = array();
    private static $utf8validator = false;
    public static function init()
    {
        self::$utf8validator = (bool) extension_loaded('utf8validator');
        mb_internal_encoding('UTF-8');
        mb_language('uni');
        mb_regex_encoding('UTF-8');
        mb_detect_order(array('UTF-8', 'ISO-8859-1'));
        mb_substitute_character(0xfffd);
        MCached::connect();
        $trans = MCached::get(self::TRANSKEY);
        if ($trans === MCached::NO_RESULT) {
            $win = "€" . implode('', range("‚", "Œ")) . "Ž" . implode('', range("‘", "œ")) . implode('', range("ž", "ÿ"));
開發者ID:Q8HMA,項目名稱:BtiTracker-1.5.1,代碼行數:31,代碼來源:class.UTF8.php


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