Re: why use {} around vraiable?

From: Date: Thu, 20 Mar 2008 16:35:21 +0000
Subject: Re: why use {} around vraiable?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-271905@lists.php.net to get a copy of this message
On Mar 20, 2008, at 12:22 PM, Lamp Lists wrote:
hi, I saw several times that some people use this $parameters = array( 'param1' => "{$_POST["param1"]}", 'param2' => "{$_POST["param2"]}" ); or $query = mysql_query("SELECT * FROM table1 WHERE id='{$session_id}'"); I would use: $parameters = array( 'param1' => $_POST["param1"], 'param2' => $_POST["param2"] ); and $query = mysql_query("SELECT * FROM table1 WHERE id=' ".$session_id." ' ");
I may have been the one you were talking about so I figured I should reply. I picked up the habit doing that for stuff that was being displayed using HEREDOC. When I asked for some help awhile back on a project I was working on and they said to use HEREDOC, and gave an example of how to do it and they had all the variables surrounded with {} So I assumed you had to do it that way... Anyone care to correct me? -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com japruim@raoset.com

« previous php.general (#271905) next »