Re: Re: Value of $_* variables
| From: | Erik Price | Date: | Wed, 06 Mar 2002 15:41:08 +0000 |
| Subject: | Re: Re: Value of $_* variables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-87477@lists.php.net to get a copy of this message | ||
On Tuesday, March 5, 2002, at 09:12 PM, James Taylor wrote:
Yeah, the curly braces work great. I was at first doing a "where id = " . $_SESSION['id'], $db); but I like the curly braces better.I like the curly braces too, but there's one time when they DON'T work: for ($i = 0; $i < $n; $i++) { echo "<li>{$_POST["name{$i}output"]}</li>\n"; } If you use this technique, which is a workable but probably bad way to write a program, you need to use braces to distinguish the counter ($i) from the rest of the variable name, and thus you can't use the curly braces around the entire variable. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com