Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with arrays and variable variables

Status
Not open for further replies.

scorpion4377

Programmer
Apr 11, 2005
13
0
0
US
Code:
$$name[1] = 2;
// This will set a variable with a name of $name[1] to 2. But, I want to do this:

$($name)[1] = 2;

// I want it to make the variable to be an array. I know I can  use $$name = array(), but that's not very dynamic.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top