Welcome to WebmasterWorld Guest from 54.160.163.163

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

variable variables & arrays

     

sssweb

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

5+ Year Member



I have the code:

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

I get this error on the last line:

"Cannot use [] for reading..."

Why?

sssweb

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

5+ Year Member



I got it -- it should be:

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

Featured Threads

Hot Threads This Week

Hot Threads This Month