Just wondering what $$variable_name does?
| SitePoint Sponsor |




Just wondering what $$variable_name does?

It references the variable whose name is in $variable_name.
For example id
$variable_name = 'x';
$x = 5;
Then $$variable_name references the 5 stored in $x.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
It should be mentioned that doing this is bad practice and shows instability in the programming itself - in other words, you should know what variables you are using.
Arrays are much more suited.
Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
Bookmarks