Redmond Militante wrote:
$essay2=nl2br($essay2);
$essay2 = str_replace( "<br />", "\par", $essay2 );
$output = str_replace( "<<essay2>>", $essay2, $output );

to preserve line breaks when generating rtf documents from the text blob essays we have in the mysql db.

this is working fine. i have recently had some requests that we add the ability to preserve rich text formatting such as bold, underline and italics to the essay question text box. apparently, the mysql data type 'text' doesn't store rich text formatting such as bold and underline. specifically, i've seen some really nice javascript(?) rich text editors in some high end web based email clients - it would be great to duplicate this type of functionality in our app, as some people would really like to preserve italics and the like in their essays.

RTF is just plain text with special markup commands embedded in it. Mysql Text columns can hold them just fine.


You should translate <i> and <b> into the corresponding RTF tags and then your formatting will be preserved.

i was wondering if anyone has had experience with coding rich text text editors, or similar experience. if you have any advice for me, i'd really appreciate hearing from you

if you want a fancy GUI editor for your web page, that is not a PHP question. do a search for activex or java text edit widgets. most of them will convert to HTML though, so you'll still have to convert the html commands to RTF in your php script.


-jsd-



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to