本文整理汇总了PHP中Multibyte::__table方法的典型用法代码示例。如果您正苦于以下问题:PHP Multibyte::__table方法的具体用法?PHP Multibyte::__table怎么用?PHP Multibyte::__table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Multibyte
的用法示例。
在下文中一共展示了Multibyte::__table方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __find
/**
* Find the related code folding values for $char
*
* @param integer $char decimal value of character
* @param string $type
* @return array
*/
private static function __find($char, $type = 'lower')
{
$found = array();
if (!isset(self::$__codeRange[$char])) {
$range = self::__codepoint($char);
if ($range === false) {
return null;
}
if (!Configure::configured('_cake_core_')) {
App::uses('PhpReader', 'Configure');
Configure::config('_cake_core_', new PhpReader(CAKE . 'Config' . DS));
}
Configure::load('unicode' . DS . 'casefolding' . DS . $range, '_cake_core_');
self::$__caseFold[$range] = Configure::read($range);
Configure::delete($range);
}
if (!self::$__codeRange[$char]) {
return null;
}
self::$__table = self::$__codeRange[$char];
$count = count(self::$__caseFold[self::$__table]);
for ($i = 0; $i < $count; $i++) {
if ($type === 'lower' && self::$__caseFold[self::$__table][$i][$type][0] === $char) {
$found[] = self::$__caseFold[self::$__table][$i];
} elseif ($type === 'upper' && self::$__caseFold[self::$__table][$i][$type] === $char) {
$found[] = self::$__caseFold[self::$__table][$i];
}
}
return $found;
}
示例2: __find
/**
* Find the related code folding values for $char
*
* @param integer $char decimal value of character
* @param string $type
* @return array
* @access private
*/
private static function __find($char, $type = 'lower')
{
$value = false;
$found = array();
if (!isset(self::$__codeRange[$char])) {
$range = self::__codepoint($char);
if ($range === false) {
return null;
}
Configure::load('unicode' . DS . 'casefolding' . DS . $range);
self::$__caseFold[$range] = Configure::read($range);
Configure::delete($range);
}
if (!self::$__codeRange[$char]) {
return null;
}
self::$__table = self::$__codeRange[$char];
$count = count(self::$__caseFold[self::$__table]);
for ($i = 0; $i < $count; $i++) {
if ($type === 'lower' && self::$__caseFold[self::$__table][$i][$type][0] === $char) {
$found[] = self::$__caseFold[self::$__table][$i];
} elseif ($type === 'upper' && self::$__caseFold[self::$__table][$i][$type] === $char) {
$found[] = self::$__caseFold[self::$__table][$i];
}
}
return $found;
}