View Full Version : Stop <br> From Echoing In Text Field

07-27-2012, 04:49 AM
Need Help

Starting a break like this But when it posts threw to the database it only displays <br/> in the text field/when a user edits the data/info like posts in a text field.
im using nl2br function in like this nl2br($_POST['value']);
how can i stop the <br/> from echoing?? like Vbulletin (this forums software) And other sites..
Ive looked all over google still stumbed!

07-27-2012, 01:44 PM
You are doing "nl2br" (new line to br), which is fine.

There is no command to do "br2nl" (the revserse), so use a function ...


echo $textarea;

// <br> or <br /> to nl function
function br2nl($str) {
return preg_replace('=<br */?>=i', "", $str);