Re: concatenating strings

From: Date: Sat, 22 May 2004 11:03:58 +0000
Subject: Re: concatenating strings
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-186759@lists.php.net to get a copy of this message
> From: "Richard Davey" <rich@launchcode.co.uk> Saturday, May 22, 2004 6:46 AM > Subject: Re: [PHP] concatenating strings > BF> how do I add newline commands in the middle of a text string? > > $message = "My name is " . $myname . "\nMy favorite color is " . $color; > > \n = new line Also "\n" only works in double quotes. If you use single quotes you need to break out and concatenate \n in double quotes. $message = 'My name is ' . $myname . "\n" . 'My favorite color is ' . $color; --- The future will be better tomorrow --- http://www.spiceplace.com/ ----------------------------------------

« previous php.general (#186759) next »