Jump to content

Recommended Posts

I am having an issue that I cannot figure out. I'm using the nl2br() function to format user entered text stored in the DB as necessary and it has never been an issue. However, for one particular entry it is giving my a problem. If I just echo the data out of the DB it displays fine, however as soon as I add the nl2br I get a huge number of unnecessary BR tags.

 

Here is the problem area from the data in the DB:

 

<p>			The below table outlines all the ranks available in the WCC. You should view Appendix C to find out the minimum requirements for each, and which sections are currently inactive. </p><table style=\"border: 1px solid #f3a61f; margin-left: auto; margin-right: auto; width: 90%; border-collapse: collapse; text-align: center;\" border=\"0\">

 

And the source code when I run it through nl2br:

 

<p>			The below table outlines all the ranks available in the WCC. You should view Appendix C to find out the minimum requirements for each, and which sections are currently inactive. Okay</p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<br>
<br>
<table style="border: 1px solid rgb(243, 166, 31); margin-left: auto; margin-right: auto; width: 90%; border-collapse: collapse; text-align: center;" border="0">

 

Link to comment
https://forums.phpfreaks.com/topic/240737-nl2br-function-creating-large-gap/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.