Re: Anyone know of better way to convert the ASCII text to html text???
| From: | Brent Baisley | Date: | Mon, 12 Apr 2004 19:56:37 +0000 |
| Subject: | Re: Anyone know of better way to convert the ASCII text to html text??? | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11799@lists.php.net to get a copy of this message | ||
Why aren't you using nl2br() to change new lines to HTML breaks? It would be a lot faster than preg_replace.
On Apr 9, 2004, at 11:35 AM, Scott Fletcher wrote:
--snip--
$user_message = preg_replace('/\n/', '',$user_message);
$user_message = preg_replace('/\r/', '<br>',$user_message);
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577