Jump to content

[SOLVED] How do I dynamically create and access variables?


ultrus

Recommended Posts

Hello,

I am trying to dynamically create new variables, and add values to those variables. In Flash, I would do so like this:

 

for(i=0;i<10;i++) {
     var this["happy" + i]:String = "I am so happy.";
}

trace(happy1); //shows "I am so happy." in the output window.
trace(happy5); //shows "I am so happy." in the output window.

 

How would I do this in php? Thanks much for the help :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.