i am trying to populate the array $workout_name[$i] with anthoer array with a range of 1 to $j
for example if $i = 1 and $j=3
then it would be like this
$workout_name[1] = array( 1, 2, 3
so will this code work?
$workout_name[$i][] = range(1, $j);
did you try it?
i actually cannot lol
it is in the same php file i am having a huge amount of trouble making, invloving multi-dimensional arrays, dynamic forms, horrid smarty code, and other such nightmares
i guess i could have put it into a mock file, but currently my webserver on my comp is down :/
since you can't test it here:
this code
<?php $j = 12; $test = array(); for($i=0;$i<10;$i++) { $test[$i] = range($i,$j); print_r($test[$i]); echo "<br><br>\n"; } //end for ?>
yielded this result:
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 [10] => 10 [11] => 11 [12] => 12 ) Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 10 [10] => 11 [11] => 12 ) Array ( [0] => 2 [1] => 3 [2] => 4 [3] => 5 [4] => 6 [5] => 7 [6] => 8 [7] => 9 [8] => 10 [9] => 11 [10] => 12 ) Array ( [0] => 3 [1] => 4 [2] => 5 [3] => 6 [4] => 7 [5] => 8 [6] => 9 [7] => 10 [8] => 11 [9] => 12 ) Array ( [0] => 4 [1] => 5 [2] => 6 [3] => 7 [4] => 8 [5] => 9 [6] => 10 [7] => 11 [8] => 12 ) Array ( [0] => 5 [1] => 6 [2] => 7 [3] => 8 [4] => 9 [5] => 10 [6] => 11 [7] => 12 ) Array ( [0] => 6 [1] => 7 [2] => 8 [3] => 9 [4] => 10 [5] => 11 [6] => 12 ) Array ( [0] => 7 [1] => 8 [2] => 9 [3] => 10 [4] => 11 [5] => 12 ) Array ( [0] => 8 [1] => 9 [2] => 10 [3] => 11 [4] => 12 ) Array ( [0] => 9 [1] => 10 [2] => 11 [3] => 12 )
hope that helps
woot thx!!!