homepage Welcome to WebmasterWorld Guest from 54.234.67.55
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library : Charter : Moderators: coopster & eelixduppy & 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved