Re: [PHP] VariableName

2001-05-24 Thread Martin Thoma
Very nice solution. Thank you ! Plutarck schrieb: > If the variable's names will be $Name1, $Name2, etc, then you'd do something > like this: > > for ($i = 1, $i <= $n) > { > /* $n will be how many variables you have. So if you have 5 variables, $n > should equal 5 */ > ${"Name" . $i} = $default

Re: [PHP] VariableName

2001-05-24 Thread Plutarck
If the variable's names will be $Name1, $Name2, etc, then you'd do something like this: for ($i = 1, $i <= $n) { /* $n will be how many variables you have. So if you have 5 variables, $n should equal 5 */ ${"Name" . $i} = $default_value; } So if $n was 3 and $default_value was 0, you'd have thre

[PHP] VariableName

2001-05-24 Thread Martin Thoma
Hello ! I want to make a dynamic formular, on which the user can enter a different number of names. So to make the form I do: for ($i = 0; $i < $anzahl; $i++) { printf ("\n", $i); } Now I want to set all the Varables Name0, Name1, Name2 etc. to a default-value. How can I do it in a for-next-l