我想将$content
部分中的输入替换为<br/>
,因此它实际上显示为我的网站上的输入
$content = $_POST['thread_content'];
$title = $_POST['title'];
$date = date('d-m-Y H:i:s');
$str = $content.split("\n").join("<br />");
$co = db::escape($str);
$ti = db::escape($title);
$id = db::escape($_GET['id']);
$user = user::getVar("id");
db::query("INSERT INTO Topics (topic_subject, topic_date, topic_cat, topic_by) VALUES ('".$ti."', '".$date."', '".$id."', '".$user."')");
//ID IS ID VAN HET BOARD! NIET VAN TOPIC ID!
$result = db::query("SELECT * FROM Topics ORDER BY topic_id DESC LIMIT 0, 1");
while($row = mysql_fetch_array($result)) {
$topicid = $row["topic_id"];
db::query("INSERT INTO Posts (post_content, post_date, post_topic, post_by, post_title, post_board) VALUES ('".$co."', '".$date."', '".$topicid."', '".$user."', '".$ti."', '".$id."')");
header("Location: ?p=Topics&id=".$topicid);
}
&GT;
但是$str = $content.split("\n").join("<br/>");
并没有按照我的意愿行事。它不会将输出字符串中的<br/>
输出到数据库。任何人都可以帮我解决这个问题吗?