keeping html formatting in text

This is a discussion on keeping html formatting in text within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi I've got some text coming out of a database, but html markup isn't being turned into formatting. ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-24-2004
Ian W
 
Posts: n/a
Default keeping html formatting in text

Hi
I've got some text coming out of a database, but html markup isn't being
turned into formatting.

For example, the text in the database is:

Some men see things as they are and say, "Why?" I dream of things
that never were and say, "Why not?"

I'm using this code to output:

$quote = HTMLSpecialChars($myrow[quote]);
$quote = nl2br($quote);
$quote = trim($quote);

echo ("<b>\"$quote\"</b><br><i>$myrow[author]</i><br>");

and this is the output:

"Some men see things as they are and say, &quot;Why?&quot; I dream of
things that never were and say, &quot;Why not?&quot;
"
George Bernard Shaw


[NB: note extra carriage return before the second quote marks. I'd sure like
to kow where that's coming from too...]

anyone any ideas?

TIA

Ian W


Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:10 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0