Constructing Arrays with loops
Posted: Fri Oct 25, 2002 7:09 am
Hello
i'm fairly new to PHP. and i've got my head round using an array for the creation of a simple table of chapers.
While working on it i wondered if it would be possible to create an array with a loop, so the contents could be say, a1, a2, a3, a4, a5.
so what would happen is a loop would increment a variable ($i) by one every time till the condition was met. then each bit of data in the variable would be set from:-
a + $i
If this is possible, is there a more common name for the technique etc and more importantly is it possible?
i'm fairly new to PHP. and i've got my head round using an array for the creation of a simple table of chapers.
While working on it i wondered if it would be possible to create an array with a loop, so the contents could be say, a1, a2, a3, a4, a5.
so what would happen is a loop would increment a variable ($i) by one every time till the condition was met. then each bit of data in the variable would be set from:-
a + $i
If this is possible, is there a more common name for the technique etc and more importantly is it possible?