Hi Guys!
I am using the following code to remove <br /> tags from a string of user entered text. Basically the code below should remove any <br /> tags added within <ol></ol> tags (if that makes sense).
Unfortunately, it doesn't work correctly and I get the following error:
Any ideas?Warning: htmlentities() expects parameter 1 to be string, array given in /home/user/public_html/classes/main.class.php on line 1212
PHP Code:$result = nl2br($result);
$result = preg_replace_callback('/<ol>(.*)<\/ol>/is', array('self', 'RestoreOl'), $result);
function RestoreOl($text)
{
$text = str_replace(array("<br />\r\n", "<br />\r", "<br />\n"), "\n", $text);
return '<ol>' . htmlentities($text) . '</ol>';
}



Reply With Quote



Bookmarks