note 61818 added to function.ereg-replace

From: Date: Mon, 13 Feb 2006 01:43:24 +0000
Subject: note 61818 added to function.ereg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-103593@lists.php.net to get a copy of this message
I was having problems with Microsoft Outlook viewing forms within email. I was only able to see the first word of the text box after I used the following code. If I entered words into the text box and used the enter key to give me a CRLF I could see in the returned data the %0D%0A string, so I assumed if I just used the ereg-replace as below it would just replace the %0D%0A with a single space... function remove_extra_linebreaks($string) { $new_string=ereg_replace("%0D%0A", " ", $string); return $new_string; } But the form as displayed by Outlook only showed the text upto the first replaced string, then it was blank! I could view the source of the email and it would show all of the text I expected. The following will show the correct data in the form function remove_extra_linebreaks($string) { $new_string=ereg_replace("%0D%0A", '+', $string); return $new_string; } ---- Server IP: 216.235.15.211 Probable Submitter: 69.17.142.218 ---- Manual Page -- http://www.php.net/manual/en/function.ereg-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61818 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61818&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61818&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61818&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61818&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61818&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61818&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61818&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61818&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#103593) next »