![]() Preserved Topic: preg_replace for "\n"? (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() 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 |
![]() preg_replace("/\n/m", "=0D=0A", $comments); |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
![]() 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 |
![]() |