Page 1 of 1

Using a loop to build an array?

Posted: Wed Aug 16, 2006 11:41 am
by GeXus
How would I use a loop that would build out an array, with the count of the loop being added to the array each time?

ex... the loop goes 5 times, i want array(1, 2, 3, 4, 5) in a variable....

Thanks!

Posted: Wed Aug 16, 2006 11:44 am
by Oren
You don't! :P

You just do:

Code: Select all

$arr = range(1, 5);
:wink:

Posted: Wed Aug 16, 2006 11:48 am
by GeXus
Oren wrote:You don't! :P

You just do:

Code: Select all

$arr = range(1, 5);
:wink:

LOL... thank you!