Hi,
I have the following code:
for($i=1;$i<=100;$i++) $auswahl$i=1;
explanation: i want the vars $auswahl1, asuwahl2, auswahl3, etc. set to 1.
How does this work?
Any Ideas?
greets,
elian
Would it work for you to set $auswahl as an array?
Example: for($i=1;$i<=100;$i++) { $auswahl[$i]=1; print($auswahl[$i]); }
regards
Nick
Not for me. I need this same solution, but without using brackets - [] as I'm having Flash read the variables in, and [] is an illegal character. $var1, is okay, $var[1], is not.
This should help. Email me if you still need help. 🙂
for ($i=0; $i<6; $i++){
$temp = "asuwahl$i"; $$temp = 1;
}
echo $asuwahl1;
echo("<br>");
echo $asuwahl2;
That's it!
Much thanks!