homepage Welcome to WebmasterWorld Guest from 54.167.249.155
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
double $$ variables
sssweb




msg:3475145
 5:35 pm on Oct 11, 2007 (gmt 0)

Is there some special meaning if a variable is designated as $$variable (as opposed to $variable), or is this simply a typo in a script I found on the web.

 

dmorison




msg:3475159
 5:44 pm on Oct 11, 2007 (gmt 0)

It is valid PHP, and means "the variable of the name in the variable". So, if you went:

$foo = "bar";
$$foo = "Hello!";
print $bar;

You would see "Hello!" displayed.

eelixduppy




msg:3475160
 5:44 pm on Oct 11, 2007 (gmt 0)

Seems like you have run into some variable variables [us2.php.net]. Although they can be extremely useful, they look pretty intense at first.

whoisgregg




msg:3475161
 5:44 pm on Oct 11, 2007 (gmt 0)

It could be a variable variable [php.net] (or a typo). :)

sssweb




msg:3475170
 5:52 pm on Oct 11, 2007 (gmt 0)

Thanks, guys

Re"
"It could be a variable variable (or a typo). :) "

Yes, but at least it's not DEFINITELY a typo...so there's hope!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved