还没有聊天内容呢!
';
} else {
//读取文件
$message = file_get_contents($file);
//转化为数组
$pieces = explode("【", $message);
$arrlength = count($pieces);
for ($x = 1; $x < $arrlength; $x++) {
$data = $pieces[$x];
//截取名字
$title = strstr($data, '】', true);
//截取内容
$content = strstr(strstr($data, "《"), "》", true);
//截取头像
$tx = strstr(strstr($data, "{"), "}", true);
//截取聊天时间
$time = strstr(strstr($data, "["), "]", true);
$tx = str_replace("{", "", $tx);
$content = str_replace("《", "", $content);
$time = str_replace("【", "", $time);
//输出内容
echo '
【'.nl2br(htmlentities($title,ENT_QUOTES,"UTF-8")).'】
《'.nl2br(htmlentities($content,ENT_QUOTES,"UTF-8")).'》
{'.nl2br(htmlentities($tx,ENT_QUOTES,"UTF-8")).'}
'.$time.']
';
}
}
?>