Re: Quotes in querys

From: Date: Wed, 14 Jan 2009 16:21:42 +0000
Subject: Re: Quotes in querys
Groups: php.general 
Request: Send a blank email to php-general+get-286322@lists.php.net to get a copy of this message
You can only interpolate ONE level of array or object indirection in a string. WORKS: "... $foo[x] ..." "... $foo->x ..." FAILS: "... $foo[x][y] ..." "... $foo->x->y ..." //almost for sure it fails, never tried... You can use curly braces in side a string to evaluate something: WORKS: "... {$foo[x][y]} ..." "... {$foo->x->y} ..." [soapbox] I personally think this is possibly the ugliest wart of variable/string interpolation. Not sure how/why it came about, but it makes zero sense, really... [/soapbox] ymmv

« previous php.general (#286322) next »