note 71366 added to function.header

From: Date: Fri, 24 Nov 2006 10:34:37 +0000
Subject: note 71366 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-120052@lists.php.net to get a copy of this message
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 ---- Server IP: 195.221.21.36 Probable Submitter: 57.66.193.71 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/71366 Del: integrated -- https://master.php.net/note/delete/71366/integrated Del: useless -- https://master.php.net/note/delete/71366/useless Del: bad code -- https://master.php.net/note/delete/71366/bad+code Del: spam -- https://master.php.net/note/delete/71366/spam Del: non-english -- https://master.php.net/note/delete/71366/non-english Del: in docs -- https://master.php.net/note/delete/71366/in+docs Del: other reasons-- https://master.php.net/note/delete/71366 Reject -- https://master.php.net/note/reject/71366 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120052) next »