note 105932 deleted from function.setcookie by danbrown
| From: | danbrown@php.net | Date: | Mon, 26 Sep 2011 16:45:19 +0000 |
| Subject: | note 105932 deleted from function.setcookie by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-183456@lists.php.net to get a copy of this message | ||
Note Submitter: Jeff in Missouri
----
vanclute at gmail dot com:
Don't tear out your hair.
Variable names expand nicely within quotes, but when you use an index reference it fails to work as
you expect.
Either leave out the quotes or put curly braces around the expression you want expanded.
either
setcookie($cookiename[id]);
or
setcookie("{$cookiename[id]}");
would have worked.
This applies to all quoted strings, not just for the setcookie function.
Cheers!