Variable variables

Hi,

I’ve got a button which is supposed to make a new variable, and give it an ongoing number.
So far i’ve got a number variable, and the contents of the variables, but i’m not sure how to put the variable together and give it the content.

Eventually it’s supposed to create a neverending list of variables (adding 1 each time you press the button).
Pressing button 1 will give: [COLOR=Blue]item1 = “button1result”;[/COLOR]
Pressing button 2 will then give: [COLOR=Blue]item2 = “button2result”;[/COLOR]
Pressing button 1 again will then give: [COLOR=Blue]item3 = “button1result”;

[COLOR=Black]So far i’ve got this when the button is pressed:

[COLOR=Blue] number = number + 1;
if(nummer == 1){
item1 = thevar;
}
else{
item [COLOR=Red][+ nummer][/COLOR] = thevar + “<br>”;
}

[COLOR=Black]How should the item variable get the proper number behind it? (the red part)[/COLOR]
[/COLOR][/COLOR]
[COLOR=Black]Hope anyone will understand… I’m trying hard to be clear about this.[/COLOR]
[/COLOR]