This is the way I like to handle collection of form inputs. Detailed explanation is in the comments.
if( isset( $_POST ) ) {
// Create an empty array. This is the one we'll eventually store.
$arr_store_me = array();
// Create a "whitelist" of posted values (field names) you'd like in your array.
// The $_POST array may contain all kinds of junk you don't want to store in
// your option, so this helps sort that out.
// Note that these should be the names of the fields in your form.
$arr_inputs = array('input_1', 'input_2', 'input_3', 'etc');
// Loop through the $_POST array, and look for items that match our whitelist
foreach( $_POST as $key => $value ) {
// If this $_POST key is in our whitelist, add it to the arr_store_me array
if( in_array( $key, $arr_inputs) )
$arr_store_me[$key] = $value;
}
// Now we have a final array we can store (or use however you want)!
// Update option accepts arrays--no need
// to do any other formatting here. The values will be automatically serialized.
update_option('option_name', $arr_store_me)
}
This is just a general approach. You can improve this by creating an array of default values for the fields, and comparing it against your “arr_store_me” array using wp_parse_args(). If you combine this with an extract($arr_store_me), it becomes a great way to prefill form fields while avoiding warnings for unset vars.