A user has the option to check off any combination of 6 check boxes on the form. After he hits submit, the following code should execute.

PHP Code:
    while (list ($key,$val) = @each ($box)) {
        echo 
"$val,";
        
$array[i] = $val ;
        echo 
$array[i] ;
        
$i $i;
        
$a $i ;    
    }

//output array contents
for ($i 1$i <= $a$i++) {

    echo 
$array[i] ;


"While ()" function is working; it outputs variables. but array (last portion of the code) is only outputting last variable checked. How can I go by storing user entered variables into array?

Thank you.