note 18193 rejected from function.str-replace by zak

From: Date: Mon, 14 Jan 2002 11:21:40 +0000
Subject: note 18193 rejected from function.str-replace by zak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-24795@lists.php.net to get a copy of this message
Isn't there any way to take formatted text, say stuff a user put in a form that you stuck in a MySQL text field, and output it formatted correctly? Like with a <pre> tag, but wrapping when you get to the edge of a fixed-width table, and the like? I could do all this replacing by hand stuff, but I'm just afraid I'll miss something... like I tried to just replace any "\t"s or sequences of spaces longer than 3 or 4 with an invisible image spacer (replacement for a tab), but when the data was stuff I'd pasted into the form from Word, it didn't work (and the stupid Word apostrophe turned into a question mark at some point). I could also try the method of replacing all \r\n's with closing and opening p tags, though it seems like I probably wouldn't be careful enough to be sure that there was always a closing tag and the like. If anyone knows of a way to do this, please let me know. Please e-mail me at westin@fas.harvard.edu. Thanks, Greg

« previous php.notes (#24795) next »