Jump to content

replace <br>


Gruzin

Recommended Posts

hi guys,
I geting data from db and I don't want to display [nobbc]<br>[/nobbc], [nobbc]</br>[/nobbc] etc... I've tryed php.net and phpfreaks, here is my effort, but think I am not on the right way. Thanks in advance.

[code]$txt = preg_replace( "<br />", "/\n/", $txt );
$txt = preg_replace( "<br>", "/\n/", $txt );
echo $txt;[/code]
Link to comment
https://forums.phpfreaks.com/topic/20223-replace/
Share on other sites

[quote author=wildteen88 link=topic=107465.msg431186#msg431186 date=1157811408]
This should do:
[code=php:0]$txt = str_replace(array("<br />", "<br>"), "\n", $text);[/code]
[/quote]
Tnak u very much, br is not any longer displayed, but still there is an empty line (br) between the text lines, any ideas what should I add that code?
Link to comment
https://forums.phpfreaks.com/topic/20223-replace/#findComment-88944
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.