note 71366 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 20 Apr 2007 14:17:40 +0000 |
| Subject: | note 71366 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125631@lists.php.net to get a copy of this message | ||
Note Submitter: H0MER
----
I think this might be useful for other people, because i searched nearly the whole web for it :)
If you need to create your own header and want to send text from a textfield with multiple lines
(\r\n - Return), you will notice, that after the first \r\n (Return) your data will be truncated.
To solve this "problem" you need to replace the \r\n in the submitted string with %0D%0A.
<?php
$formatted_string = preg_replace('/(\r\n)/', '%0D%0A', $unformatted_string);
?>
I hope this will help others to avoid hours of searching :).
With kind regards
H0MER