Re: [PHP] next,key,current question

2003-11-14 Thread Marek Kilimajer
Sara Daugherty wrote: I am having trouble with creating a list box. I am attaching the code. I am not sure the code in the for loop close to the end of the program is correct. If someone could take a look at it I would appreciate it. Thanks, Sara I like to use foreach: foreach($Classes as $Clas

RE: [PHP] next,key,current question

2003-11-13 Thread Chris Hubbard
Sara, Try this: $count = count ($Classes); for($i=0; $i<$count; $i++){ $CurrentIndexValue = key($Classes); $CurrentContents = current($Classes); echo "$CurrentContents"; next($Classes); } instead of the for loop you're using. currently you're doing a next first, w