Re: $ vs $$
| From: | Sebastian Bergmann | Date: | Sat, 18 Nov 2000 09:19:22 +0000 |
| Subject: | Re: $ vs $$ | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26032@lists.php.net to get a copy of this message | ||
Dallas Kropka wrote:
> I have seen places where $$ is used. When should I use $$ and what
> does it do.
$ marks the beginning of a variable, $variable for instance.
$$ marks a variable with variable variable names:
$varname = "variable";
$$varname = "test";
print $variable; // output: "test"
--
<? print implode( "", array_reverse( preg_split( "//", "dlrow laer
" .
"eht ot emoclew" ) ) ); /* visit http://www.sebastian-bergmann.de/ */ ?>