![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
//---------------------------------------------function format_output---------------------------------------------// function format_output($output) { /*********************************************************** * 处理原始的字符串($output)并且进行格式化处理,使用特殊的与html * 相似的标记 ************************************************************/ $output = htmlspecialchars(stripslashes($output)); /* 新的段落 */ $output = str_replace('[p]', '
', $output); /* 黑体 */ $output = str_replace('', '', $output); $output = str_replace('', '', $output); /* 斜体*/ $output = str_replace('', '', $output); $output = str_replace('', '', $output); /* 预览格式 */ $output = str_replace('[pre]', '
', $output); $output = str_replace('[/pre]', '', $output);
/* 换行符号*/
$output = str_replace('[br]','',$output); $output = str_replace('[/br]','',$output); /* 缩进块 (blockquote) */ $output = str_replace('[indent]', '
', $output); $output = str_replace('[/indent]', '', $output); /* 锚点*/ $output = ereg_replace( '\[anchor="([[:graph:]]+)"\]', '', $output); /* 链接,注意我们打算阻止Javascript出现在链接中 */ $output = str_replace('[link="javascript', '[link=" javascript', $output);$output = ereg_replace( '\[link="([[:graph:]]+)"\]', '', $output);$output = str_replace('[/link]', '', $output); return nl2br($output); }
提问者:zoneboys 08-14 11:11
答复

