Preserved Topic: preg_replace for "\n"? (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 08-08-2002 08:41
I enter data via a form into a MySQL database (via PHP). One of the form fields is a textarea. I need to convert line breaks/carriage returns to "=0D=0A". An example would be |
Paranoid (IV) Inmate From: Lebanon |
posted 08-08-2002 09:16
preg_replace("/\n/m", "=0D=0A", $comments); |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 08-08-2002 09:20
Pugzly, I suggest that you use str_replace() function insetad of preg_replace() for such simple search/replace operation (preg_replace() is really an overkill in this case)... |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 08-08-2002 18:29 |