本文整理汇总了PHP中Chinese::g2b方法的典型用法代码示例。如果您正苦于以下问题:PHP Chinese::g2b方法的具体用法?PHP Chinese::g2b怎么用?PHP Chinese::g2b使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chinese
的用法示例。
在下文中一共展示了Chinese::g2b方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($tpl_file, $cache_fileID = null, $html = false, $htmFile = null, $lng = 'cn', $xml_fileex = null)
{
$this->lng = $lng;
if (!empty($xml_fileex)) {
$tpl_file = $this->templatesDIR . $tpl_file . $xml_fileex;
} else {
$tpl_file = $this->templatesDIR . $tpl_file . $this->templatesfileex;
}
if (!is_dir($this->tpl_dir) || !is_dir($this->tpl_c_dir)) {
exit('Error[2]:Please set up correctly TemplateDIR and CacheDIR');
}
$template_file = $this->tpl_dir . $tpl_file;
if (!file_exists($template_file)) {
exit('Error[3]:Template file does not exist,Path:' . $tpl_file);
}
if ($this->caching) {
if (!is_dir($this->cache_dir)) {
exit('Error[4]:Please correct cacheDIR settings');
}
} else {
}
$out = $this->fetch($tpl_file, $cache_fileID);
if (strpos($out, $this->_linkechash)) {
$includefile = explode($this->_linkechash, $out);
foreach ($includefile as $key => $val) {
if ($key % 2 == 1) {
$val = str_replace('|', '', $val);
$includefile[$key] = $this->fetch($val);
}
}
$out = implode('', $includefile);
}
if (strpos($out, $this->_includeechash)) {
$includefile = explode($this->_includeechash, $out);
foreach ($includefile as $key => $val) {
if ($key % 2 == 1) {
$val = str_replace('|', '', $val);
$includefile[$key] = $this->fetch($val);
}
}
$out = implode('', $includefile);
}
if (strpos($out, $this->gethash)) {
$getout = explode($this->gethash, $out);
foreach ($getout as $key => $val) {
if ($key % 2 == 1) {
$getvalue = explode($this->gethashtable, $val);
list($getval, $tempbreak) = $getvalue;
$getout[$key] = $this->insert_get_mod($getval, $tempbreak);
}
}
$out = implode('', $getout);
}
if (strpos($out, $this->_echash)) {
$k = explode($this->_echash, $out);
foreach ($k as $key => $val) {
if ($key % 2 == 1) {
$k[$key] = $this->insert_mod($val);
}
}
$out = implode('', $k);
$out = $this->format_js($out);
}
if (strpos($out, $this->_listechash)) {
$k = explode($this->_listechash, $out);
foreach ($k as $key => $val) {
if ($key % 2 == 1) {
$k[$key] = $this->insert_mod($val);
}
}
$out = implode('', $k);
$out = $this->format_js($out);
}
if (strpos($out, $this->findhash)) {
$findout = explode($this->findhash, $out);
foreach ($findout as $key => $val) {
if ($key % 2 == 1) {
$filevalue = explode('|', $val);
list($findmodel, $findclass, $findfiled) = $filevalue;
$findout[$key] = $this->insert_find_mod($findmodel, $findclass, $findfiled);
}
}
$out = implode('', $findout);
}
if ($this->lng == 'big5') {
$out = $this->protection($out);
require_once admin_ROOT . 'public/class.Chinese.php';
$codechange = new Chinese(admin_ROOT . 'public/config/');
ob_start();
eval('?' . '>' . trim($out));
$name = ob_get_contents();
ob_end_clean();
$out = $codechange->g2b($name);
if ($html) {
ob_start();
echo $out;
$content = ob_get_contents();
ob_end_clean();
$this->cachefilewrite($htmFile, $content);
} else {
//.........这里部分代码省略.........
示例2: codeing
function codeing($out, $getcode = 'ub')
{
require_once admin_ROOT . 'public/class.Chinese.php';
$codechange = new Chinese(admin_ROOT . 'public/config/');
if ($getcode == 'ub') {
$out = $codechange->u2g($out);
$out = $codechange->g2b($out);
} elseif ($getcode == 'bu') {
$out = $codechange->b2u($out);
} elseif ($getcode == 'ug') {
$out = $codechange->u2g($out);
} elseif ($getcode == 'gu') {
$out = $codechange->g2u($out);
} elseif ($getcode == 'gb') {
$out = $codechange->g2b($out);
} elseif ($getcode == 'bg') {
$out = $codechange->b2g($out);
}
return $out;
}