Results 1 to 5 of 5
Oct 15, 2004, 04:02 #1
Adding variable to another variable name
I've got a variable called $question
I'm running a "for" loop and i want $i to be added to the $question variable name above.
So for example
if $i = 3
I want to write an expression which says $question3
I know how to do this in flash, but am perplexed in php.
Any help would be greatly appreciated.
Oct 15, 2004, 04:03 #2
Oct 15, 2004, 04:03 #3
cheers mi dear :-)
Oct 15, 2004, 07:51 #4
ok, i've tried this and this does not work
what it does is concatenate the contents of $question and $i
so if $question is 30 and $i is 1
the result is 301
I want $question1
any other ideas?
Oct 15, 2004, 09:14 #5
- Join Date
- May 2004
- 0 Post(s)
- 0 Thread(s)
$newvar = 'question'.$i;