HTML tags in a php text var are getting displayed literally
Posted: Mon Oct 29, 2007 7:40 pm
Code: Select all
preg_replace( '(<p>|</p>)', '', $row->post_text);<p> and </p> when the result is spit back out and displayed in my forum.
How can I have nice paragraphs in the text that's spit back out without having the literal paragraph tags?
I tried
Code: Select all
preg_replace( '(<p>|</p>)', '\n', $row->post_text);I'm getting literalled to death here.
Here's the whole bit
Code: Select all
function bb_quote_message() {
global $bbdb, $topic;
$post_id = (int)$_GET['quote'];
$the_author = $_GET['author'];
$the_author = str_replace('!~', ' ', $the_author);
if ($post_id) {
$row = $bbdb->get_row("SELECT * FROM $bbdb->posts WHERE post_id={$post_id} AND topic_id={$topic->topic_id} AND post_status=0");
$row->post_text = rtrim(preg_replace( '(<p>|</p>)', '', $row->post_text));
if ($row) echo ($the_author.' said:<br />'.htmlentities('<blockquote>'.$row->post_text.'</blockquote>', ENT_COMPAT, 'UTF-8')."\n");
}
}