Welcome to WebmasterWorld Guest from 54.162.214.65

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

variable variables & arrays

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

Preferred Member

10+ Year Member

joined:Nov 10, 2005
posts:387
votes: 0


I have the code:

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

I get this error on the last line:

"Cannot use [] for reading..."

Why?
4:20 pm on Jan 18, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 10, 2005
posts:387
votes: 0


I got it -- it should be:

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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members