Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 2
Location: Michigan
Trades: 0
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
 
 
Register now for full access!
Old 03-18-2005, 04:53 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
php has a function nl2br() that will have this effect. Try hunting for those.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 03-19-2005, 01:08 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
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, 01:10 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 03-19-2005, 01:14 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
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, 12:07 AM
mytinytown's Avatar
Junior Talker

Posts: 2
Location: Michigan
Trades: 0
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
 
Reply     « Reply to PHP <br /> line ends
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.23366 seconds with 12 queries