“Undefined index” error when saving empty array with checkboxes

I’m not seeing the original snippet from before so I’m not sure of the context anymore. The undefined index notice you are getting is telling you that $_POST['remove_fiel‌​d'] does not exist. If no checkbox in your array was set, the $_POST array will not have an index for 'remove_field', and you’ll see the error.

To prevent this from happening, ensure it exists:

if ( isset( $_POST['remove_field'] ) ) {
    // do stuff with the values
}

When in an OO context the more frequent solution is to bail out if no value exists so you would reverse your condition:

if ( !isset( $_POST['remove_field'] ) ) {
    return;
}