/    Sign up×
Community /Pin to ProfileBookmark

problem formatting plain text

Hi guys,

I am trying to display data from MySQL database. The field type is longtext and it contains data that was converted from Excel to CSV. In Excel data concisted of three paragraphs, in database those three paragraphs are showing correctly. Howerver, when I display data in HTML all formatting is lost and there are no paragraphs. I tried using nl2br() but it does not work. Does it mean that data had wrong formatting in Excel in the first place? Any suggestions?

thanks,
webtekie

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogOct 14.2006 — Try wrapping the output in HTML <pre>...</pre> tags, perhaps?
Copy linkTweet thisAlerts:
@webtekieauthorOct 14.2006 — Yeah, I did that but the problem is that all paragraphs have 4-5 sentences and so <pre> tag doesn't wrap these paragrpahs and thus this makes page wider than it should be. I tried to put <pre> in table and set specific width for table - doesn't work.
×

Success!

Help @webtekie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...