dynamic variables generated from loop
Posted: Fri Sep 29, 2006 5:24 am
Refer to the snippet below:
$i=0;
for($i=0;$i<=$n;$i++){
$var.$i=$_POST["query".$i];
}
I just need to generate variables out of the loop. e.g. $var1,$var2,$var3...
I've tried the snippet using the format above but it never worked. Any solution for this?
$i=0;
for($i=0;$i<=$n;$i++){
$var.$i=$_POST["query".$i];
}
I just need to generate variables out of the loop. e.g. $var1,$var2,$var3...
I've tried the snippet using the format above but it never worked. Any solution for this?