(.*?)<\/q>/ise',
'sprintf("%s",'
. 'urlencode(mb_convert_encoding("\"$1\"", "UTF-8", "SJIS-win")), htmlspecialchars("$1"))',
$msg
);
/**
* 縦メッセージ成形
*/
if ($tate === 1 || ($tate === 2 && rand(0, 1))) {
$tbl = $tmp = '';
$i = 0;
foreach (preg_split('/
/i', $msg) as $line) { // "
"位置で分割して順に行処理
$tmp = sprintf(
'',
(++$i % 2 ? $tate_bgcolor1 : $tate_bgcolor2),
$tate_width,
$font_size,
$font_color
);
// 一文字単位に分割しては" "付加を繰り返す
preg_match_all('/((?:<[^>]*>)?(?:?\w+;|[\x81-\x9f\xe0-\xfc][\x40-\x7e\x80-\xfc]|'
. '[\x09\x0a\x0d\x20-\x7e\xa1-\xdf]))/', $line, $match);
foreach ($match[1] as $wchar) {
// 長音(ー)を縦棒に置換など
if (preg_match('/\x81\x5B$/', $wchar)) $wchar = str_replace('ー', '│', $wchar);
elseif (preg_match('/(?:「|『|(|\()$/', $wchar)) $wchar = preg_replace('/(?:「|『|(|\()$/', '∧', $wchar);
elseif (preg_match('/(?:」|』|)|\))$/', $wchar)) $wchar = preg_replace('/(?:」|』|)|\))$/', '∨', $wchar);
$tmp .= $wchar . ' ';
}
$tmp .= ' | ';
$tbl = $tmp . $tbl;
}
$msg = '\n";
} else {
$msg = "" . $msg . "";
}
/**
* 画面表示
*/
$title = htmlspecialchars($title);
echo <<
{$title}
<body bgcolor="{$bgcolor}">
{$title}
{$msg}