Re: extra breaks in sent out emails

From: Date: Sun, 07 Mar 2004 16:11:14 +0000
Subject: Re: extra breaks in sent out emails
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-179702@lists.php.net to get a copy of this message
Scott Taylor wrote:
What I really don't understand is why there are any line breaks at all, because the trim is supposed to take out all \r & \n 's. Is there another type of line break?
trim() actually only strips whitespace (including \r and \n) from the beginning and ending of strings. See http://www.php.net/trim for more information. If you want to completely remove line breaks from your string, use str_replace() to do something like: str_replace("\n", "", $string); and str_replace("\r", "", $string); See http://www.php.net/str-replace Finally, have you tried echoing $body just before the message is sent so that you can see exactly what is being sent to the mail() function? -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey

« previous php.general (#179702) next »