Re: question about quote and double-quoted strings

From: Date: Sun, 09 Feb 2003 00:08:21 +0000
Subject: Re: question about quote and double-quoted strings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-134913@lists.php.net to get a copy of this message
http://www.php.net/manual/en/language.types.string.php Just the way ' and " are defined. " understands more escape sequences then '. Justin Garrett "Duncan" <php-general@ring-wraith.com> wrote in message news:3E459C45.5060101@ring-wraith.com... > Hi, > > i am just adding some mail() functions to my script and had to realize, > that this: > > $email_from = 'From: pipetest@domain.com\r\nReply-To: > pipetest@domain.com\r\n'; > mail($_POST['email'],'Your account details','You can login with your > account details\r\nusername: '.$_POST['username'].'\npassword: > '.$_POST['password'].'\n\nhere: > http://----/index.php',$email_from); > > will make the email include the \r\n instead of adding a line feed, but > this works just fine: > > $email_from = "From: pipetest@domain.com\r\nReply-To: > pipetest@domain.com\r\n"; > mail($_POST['email'],'Your account details',"You can login with your > account details\r\nusername: ".$_POST['username']."\npassword: > ".$_POST['password']."\n\nhere: > http://----/index.php",$email_from); > > Why is there this difference in the normal- & double-quoted string, i > though it would only affect included variables, where one shows them and > the other would need them to be added via '.' ? > > ...just curious :) > > Regards, > Duncan >

« previous php.general (#134913) next »