note 18193 added to function.str-replace

From: Date: Mon, 14 Jan 2002 06:53:39 +0000
Subject: note 18193 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-24789@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 -- http://www.php.net/manual/en/function.str-replace.php http://master.php.net/manage/user-notes.php?action=edit+18193 http://master.php.net/manage/user-notes.php?action=delete+18193 http://master.php.net/manage/user-notes.php?action=reject+18193

« previous php.notes (#24789) next »