maltrecho
12-04-2003, 09:52 AM
The following is just an example, but is exactly what I need to know to apply it to the real code. How can I do it?
/*THIS NUMBER WILL BE DEFFERENT EACH TIME */
$number = 5;
for ($i = 1; $i <= $number; $i++) {
/* THIS DOESNT WORK */
$string_$i = ($i + 5);
}
So the result should be:
$string_1 = 6;
$string_2 = 7;
$string_3 = 8;
$string_4 = 9;
$string_5 = 10;
/*THIS NUMBER WILL BE DEFFERENT EACH TIME */
$number = 5;
for ($i = 1; $i <= $number; $i++) {
/* THIS DOESNT WORK */
$string_$i = ($i + 5);
}
So the result should be:
$string_1 = 6;
$string_2 = 7;
$string_3 = 8;
$string_4 = 9;
$string_5 = 10;