I have a foreach that checks the number of sessions in my php site and for each session it fetches from a db the name of an item. I would like to store the names sequentially in va
Solution 1:
Before the foreach define an array to store results in:
$mySessions = array();
Then after the $row2 = .... line:
$mySessions[] = $row2;
Then you will have the array populated so you can use it after your loop is completed.
Share
Post a Comment
for "Storing Elements In An Array At Each Iteration Of A Foreach On Php"
Post a Comment for "Storing Elements In An Array At Each Iteration Of A Foreach On Php"