Jump to content

Selectively using nl2br


DonkeyWhiskers

Recommended Posts

Say I have a text field like this

 

$text = "

BLAH

BLAH

 

BLAH

 

BLAH

 

BLAH

";

 

Those BBCode tags will be replaced with HTML sooner or later. I use the nl2br function to put in line breaks but nl2br will put a load of unwanted line breaks in there because of the BBCode tags. How do I stop it from putting in line breaks in between BBCode tags?

Link to comment
https://forums.phpfreaks.com/topic/200298-selectively-using-nl2br/
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.