A form similar to the following, taken from the above example plus some additions.
<form>
<input type="text" name="personal_details[]" />
<input type="text" name="personal_details[]" />
<input type="text" name="pictures[]" />
<input type="text" name="pictures[]" />
<input type="text" name="details[first_name]" />
<input type="text" name="details[last_name]" />
</form>
This can be used in your controller or model as follows.
echo $this->input->post( 'personal_details' )[ 0 ];
echo $this->input->post( 'personal_details' )[ 1 ];
echo $this->input->post( 'pictures' )[ 0 ];
echo $this->input->post( 'pictures' )[ 1 ];
echo $this->input->post( 'details' )[ 'first_name' ];
echo $this->input->post( 'details' )[ 'last_name' ];
I hope this helps. I was interested in doing the same thing and experimenting until I found this solution.
source
share