Re: correct syntax
| From: | dorgon | Date: | Wed, 25 Jun 2003 08:08:45 +0000 |
| Subject: | Re: correct syntax | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152723@lists.php.net to get a copy of this message | ||
Harry Wiens wrote:
What would be the correct syntax? 1. $_SESSION[test]in this case "test" is a constant and must be defined by calling define("test", some_integer_value) before
2. $_SESSION['test']this is correct. but variables will not be equaled in the string. so when using '' brackets, you cant write $var = 'hello $name!'. even escape chars (\n, etc.) aren't resolved.
3. $_SESSION["test"]this is best practise for most cases. you can write variables inside the string, which will be substituted by their values and escape chars are resolved
mfg. harry wiens