Re: concatenating strings and \n's for mail...

From: Date: Thu, 15 Feb 2001 04:03:48 +0000
Subject: Re: concatenating strings and \n's for mail...
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-39806@lists.php.net to get a copy of this message
* CC Zona <cczona@nospam.invalid> [010214 21:21]: > [restored to bottom-posting, for clarity] > > > > > I was trying to build up a multi-line body to use with the mail > > > > command, using code similar to: > > > > $mailbody = $mailbody . '\n' . > > > > $HTTP_POST_VARS["somefield"]; > > <snip> > > > > I think you can do it like this: > > > > > > $mailbody="$varname\n$varname2"; > > That works. Hmm. I wonder why the concatenation didn't? > > Because '\n' is a string consisting of a backslash followed by the letter > n, while "\n" is a newline character. Gotta use double-quotes. I even had trouble within double quotes with the concatenation. LER -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749

« previous php.general (#39806) next »