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

PHP Server Side Scripting Forum

    
variable variables & arrays
sssweb




msg:4408166
 4:13 pm on Jan 18, 2012 (gmt 0)

I have the code:

$name = array();
$x = 'name';
$$x[] = 'value';

I get this error on the last line:

"Cannot use [] for reading..."

Why?

 

sssweb




msg:4408170
 4:20 pm on Jan 18, 2012 (gmt 0)

I got it -- it should be:

${$x}[] = 'value';

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