Re: function definition causing problems?
| From: | Erik Price | Date: | Mon, 24 Jun 2002 17:11:38 +0000 |
| Subject: | Re: function definition causing problems? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103624@lists.php.net to get a copy of this message | ||
On Monday, June 24, 2002, at 12:15 PM, Johnson, Kirk wrote:
When you echo out an array element, the name needs to be enclosed in curlies, e.g., echo {$_SERVER['PHP_SELF']}I think that this is only important when using an associative array element reference within certain kinds of quotes. Like this: // this won't work b/c of quoting issues echo "This script is called $_SERVER["PHP_SELF"]"; // this should work fine IIRC echo "This script is called $_SERVER['PHP_SELF']"; // this should also work if for some reason you needed // to use double quotes within the array element reference // (to interpolate a variable, for instance) echo "This script is called {$_SERVER["PHP_SELF"]}"; // and this is the same thing really echo "This script is called ${_SERVER["PHP_SELF"]}"; Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com