Reply
PHP <br /> line ends
Old 03-18-2005, 05:22 PM PHP <br /> line ends
mytinytown's Avatar
Junior Talker

Posts: 2
Location: Michigan
In the CMS system I am using it does an auto <br /> tag at the end of each line if you hit the enter key. I know very little about php so I am not finding what is cauing this.

Example:

If I typed this in the content box.



And did a few enter strokes in the HTML of the page I'll see the <br /> tag for each enter stroke. So the above would look like.
<br />
<br />
<br />
instead of



A friend suggested the preg_replace command and I do see a few of them, but they all seem to be related to the images instead of html text.

If you do not understand what I am trying to say, please let me know I am not good at explaining things. If you would have any clues on what could cause this, I would be most thankful for your help!!!!

I do understand adding the <br /> at the line end for the enter key is usually a nice thing if you like it, but when you try to build a table and each line end has a <br /> it messes up tables.
mytinytown is offline
Reply With Quote
View Public Profile Visit mytinytown's homepage!
 
When You Register, These Ads Go Away!
Old 03-18-2005, 05:53 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
php has a function nl2br() that will have this effect. Try hunting for those.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';
Scribble Pad MOD for phpBB (aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 03-19-2005, 02:08 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
It is worth pointing out that most browsers ignore repeated <br> tags -- you'll end up with just one effective break.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 03-19-2005, 02:10 PM
Christopher's Avatar
Iced Cap

Posts: 3,111
Location: Toronto, Ontario
Quote:
Originally Posted by Kyrnt
It is worth pointing out that most browsers ignore repeated <br> tags -- you'll end up with just one effective break.
I don't think so. You must be thinking of repeating spaces/newlines, with HTML not caring about whitespace. For example:





Each of the above is a single line break. And this line has 20 or so leading spaces, but you don't see them.

HTML Code:
I don't think so. You must be thinking of repeating spaces/newlines, with HTML not caring about whitespace. For example:<br />
<br />
<br />
<br />
<br />
<br />
                                                   Each of the above is a single line break. And this line has 20 or so leading spaces, but you don't see them.
Christopher is offline
Reply With Quote
View Public Profile Visit Christopher's homepage!
 
Old 03-19-2005, 02:14 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
I stand corrected -- I was thinking newlines. Thanks, Chroder.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 03-21-2005, 01:07 AM
mytinytown's Avatar
Junior Talker

Posts: 2
Location: Michigan
Quote:
Originally Posted by 0beron
php has a function nl2br() that will have this effect. Try hunting for those.
You rock! That is what it was!!!!!!

Took only a few tries to get the correct one!
__________________
I don't want a signature today!
mytinytown is offline
Reply With Quote
View Public Profile Visit mytinytown's homepage!
 
Reply     « Reply to PHP <br /> line ends
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.15804 seconds with 12 queries