<input type="checkbox" name="ANin[]" value="AN1_in" <?php if(in_array('AN1_in',$_POST['ANin'])) echo 'checked'; ?>>
and so on for AN2_in
, AN3_in
etc. Rather than repeating this manually for all 4 (or more) checkboxes, you could also write a simple loop to generate all of them with proper values.