我在一个类中有一个函数:
public function displayComments($postorpage, $id_postorpage){
$query = mysql_query("SELECT * FROM `".DB."`.`mmsv_servers_page_comments` WHERE `id_postorpage`='$id_postorpage'");
while($comment = mysql_fetch_object($query)){
$added = new Time;
$elapsed = $added->displayElapsedSignificant($comment->data);
echo "
<h3>$comment->nick</h3>
<i>$elapsed</i>
<p>".addSecurityView($comment->text)."</p>
";
}
}
并且应该删除断线的函数 addSecurityView 不起作用:
function addSecurityView($value)
{
$result = preg_replace(array("/\r\n\r\n/", "/\n\n/"), array("\r\n", "\n"), $value);
return $result;
}