why use {} around vraiable?
| From: | Lamp Lists | Date: | Thu, 20 Mar 2008 16:22:34 +0000 |
| Subject: | why use {} around vraiable? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-271903@lists.php.net to get a copy of this message | ||
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." '
");
does it really matter? is there really difference or these are just two "styles"?
thanks.
-ll
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ