The only think you need to pass the while statement is a valid array (in this case called $chk).
The statement: while(list($key, $val)=each($chk)) -- will go through each item in the array and assign the key name to $key and the value of that key to $val.
Thus, if you had an array like this:
$chk(0) = "Test 1"
$chk(1) = "Test 2"
Then $key would be "0" and $val would be "Test 1" on the first iteration of the loop, then $key would be "1" and $val would be "Test 2" on the second.
Hope this makes sense. 🙂
John Cornett