RE: [PHP] Looping through a list - Newbie question

2003-08-27 Thread James Johnson
. Holmes [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 7:23 AM To: James Johnson; [EMAIL PROTECTED] Subject: Re: [PHP] Looping through a list - Newbie question From: "James Johnson" <[EMAIL PROTECTED]> > I have a list contained in a session var. I want to loop throu

Re: [PHP] Looping through a list - Newbie question

2003-08-27 Thread CPT John W. Holmes
From: "James Johnson" <[EMAIL PROTECTED]> > I have a list contained in a session var. I want to loop through the list, > getting the value of the current item, then do a query based on that value. > Is there an easy way to do this, or do I need to convert the list to an > array first? In the code b

RE: [PHP] Looping through a list - Newbie question

2003-08-27 Thread Javier Tacon
There are a lot of methods. The most common is using an array: $_SESSION['sv_CampusList'] = Array ("1","2","3","4","5"); foreach($_SESSION['sv_CampusList'] as $id) { echo $id; } If you want to use sv_CampusList as string: $_SESSION['sv_CampusList'] = "1,2,4,5"; $tmpArr = explode(",",$_SESSION