Re: ${}

From: Date: Wed, 25 Apr 2007 14:09:12 +0000
Subject: Re: ${}
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-253709@lists.php.net to get a copy of this message
Robert Cummings wrote: > On Wed, 2007-04-25 at 21:23 +0800, Man-wai Chang wrote: >> where can I find the documentation about this "symbol"? > > Maybe in the documentation? A cursory glance from me though didn't turn > anything up. Either way I can inform you of the purpose... > > The following two expression have the same result: > > $foo = 5; > ${'foo'} = 5; It's also useful to separate out your vars when using replacements in double quotes.. cf. $like = "Hmmm"; $var1 = "Something $like_this"; vs. $var2 = "Something ${like}_that"; $var1 = "Something " + PHP Notice $var2 = "Something Hmmm_that"; Col.

« previous php.general (#253709) next »