ニコニコ動画 アニメ ..
[2ch|▼Menu]
734:たまご ◆EGGMAN.HlI
09/02/26 21:02:17 /TbohrHr0
function aas_decodeHTMLEntity($e)
{
global $_conf;
$specialchars = array(
'amp' => '&',
'gt' => '>',
'lt' => '<',
'quot' => '"',
'nbsp' => ' '
);
$entity = $e[0];
$code = $e[1];

if (isset($specialchars[$code])) {
return $specialchars[$code];
}

if (substr($code, 0, 1) == '#') {
if (substr($code, 1, 1) == 'x') {
$code = hexdec(substr($code, 2));
} else {
$code = (int) substr($code, 1);
}

if ($code == 160) {
return ' ';
}

if ($code > 31 && $code != 127 && $code < 65536) {
$entity = sprintf('?%d;', $code);
$cnvmap = array(32, 65535, 0, 65535); // (0x20, 0xFFFF, 0, 0xFFFF)
return mb_decode_numericentity($entity, $cnvmap, AAS_INTERNAL_CHARSET);
}
}

return $_conf['expack.aas.unknown_char'];
}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5384日前に更新/224 KB
担当:undef