本文整理汇总了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 = "Â ";
// # 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("ž", "ÿ"));