December 29th, 1999, 11:42 AM
Could someone please enlighten me?
I am trying to display an associative array.
The array has been created properly because
the proper values are displayed with know
keys. Why then does the following snip of
code only display 1 array value when I know
there are more?
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
list($value,$option) = each($employee_select);
print "<option value="" . $value . "">" . $option . "</option>n";
Could anyone post a nice little example of
how to do this correctly?
December 29th, 1999, 06:07 PM
Well, I don't know why it's not working, but I do see a problem. each() and next() both advance the array pointer. If you only have two elements that would be why you have a problem.
Instead of a do..while loop, just use a while.
print "<option value="$value">$option"<option>n";