I'm creating an html form that will allow a user to specify a variable-length number of fields to submit (fields added/removed client side via javascript).

I want to be able to deal with these submissions as a two dimensional array server side, something like:

```
array(
    array(
        'venue_name' = 'venue 1',
        'venue_description' => 'nighlife',
        'venue_street_address' => '111 fake street'
        ....
    ),
    array(
        'venue_name' ...
    )
);

```

![enter image description here](https://i.stack.imgur.com/Hr8KE.png)

This is the form HTML I'm working with:

```
<form>
    <div style="border:1px solid white;">
        <label>Venue Name:</label><br><input name="venue_name[]" type="text" /><br>
        <label>Description:</label><br><input name="venue_desc[]" type="text" /><br>
        <label>Street Address:</label><br><input name="venue_street_address[]" type="text" /><br>
        <label>City:</label><br><input name="venue_city[]" type="text" /><br>
        <label>State:</label><br><input name="venue_state[]" type="text" /><br>
        <label>Zip:</label><br><input name="venue_zip[]" type="text" /><br>
    </div>
    <div style="border:1px solid white;">
        <label>Venue Name:</label><br><input name="venue_name[]" type="text" /><br>
        <label>Description:</label><br><input name="venue_desc[]" type="text" /><br>
        <label>Street Address:</label><br><input name="venue_street_address[]" type="text" /><br>
        <label>City:</label><br><input name="venue_city[]" type="text" /><br>
        <label>State:</label><br><input name="venue_state[]" type="text" /><br>
        <label>Zip:</label><br><input name="venue_zip[]" type="text" /><br>
    </div>
</form>

```

I use jQuery's .serialize() function to submit the form to my server via ajax, and this is how it arrives:

```
team_name=team+wild&venue;_name[]=venue+1&venue;_desc[]=nighlife&venue;_street_address[]=111+Fake+Street&venue;_city[]=Boston&venue;_state[]=MA&venue;_zip[]=02115&venue;_name[]=venue+2&venue;_desc[]=desc&venue;_street_address[]=115+rake+street&venue;_city[]=Boston&venue;_state[]=MA&venue;_zip[]=03030

```

How might I go about converting this submission string to an array in the format I'm looking for, and is this the best way to go about handling a situation such as this? (variable length sets of form fields)

**EDIT 1**

```
jQuery.ajax({
            url: window.location,
            type: 'post',
            data: {
                    'vc_method': 'step_submit',
                    'fan_page_id': jQuery('#fan_page_id').html(),
                    'submit_data': jQuery(main_holder_body).find('form#setup_form').serialize()
                  },
            cache: false,
            dataType: 'json',
            success: function(data, textStatus, jqXHR){

                console.log(data);

            }
        });

```