I have a "For loop" routine. As it iterates through, I would like to put the results of each iteration into an array however i'm not really sure how to do this.
The code I am using is as follows:
Code: Select all
<?php
for($i=1; $i<=$Usercount; $i++)
{
//I get a name from elsewhere at this point and put it into a variable called $User. I then want to put it into an array....
$Users = array($User)
}
?>What I would like is for the array to contain:
[0] => "first name"
[1] => "Second name"
[2] => "Third name"
and so on.
Please can anyone help me with the correct method of doing this.
Thanks
RM