I am explaining my scenario as
i have form in which adding checkbox row multiple times. in first row checkbox values from Monday to Sunday In second row checkbox values also from monday to sunday. I mean to say every row handling on Add Button. Below is the view.php code
<div id="myDIV1" class="form-group col-md-3 col-lg-3 col-sm-3 col-xs-12"><label for="day" class="control-label">Day</label><br><label class="checkbox-inline"><input type="checkbox" name="day[]" value="Monday">Monday</label><label class="checkbox-inline"><input type="checkbox" name="day[]" value="Tuesday">Tuesday</label><label class="checkbox-inline"><input type="checkbox" name="day[]" value="Wednesday">Wednesday</label><label class="checkbox-inline"><input type="checkbox" name="day[]" value="Thursday">Thursday</label><label class="checkbox-inline"><input type="checkbox" name="day[]" value="Friday">Friday</label><label class="checkbox-inline"><input type="checkbox" name="day[]" value="Saturday">Saturday</label><label class="checkbox-inline"><input type="checkbox" name="day[]" value="Sunday">Sunday</label><?php echo form_error('day'); ?></div>
Below is the controller code.....
$day = implode(',', $this->input->post('day'));
i am using implode bcoz suppose in the first row i have checked Monday and Sunday so it will give me value as Monday, Sunday
My Scenario is i have checked Monday, Sunday from first row and also checked Tuesday, Wednesday from secound row
According to my code i am getting result as Monday, Sunday, Tuesday, Wednesday in $day But i want to store Monday, Sunday in first row of table and Tuesday, Wednesday in second row of table. I am sharing the image link as below https://drive.google.com/open?id=1k8bYsRUJFo9mI2AY6D-d4MGHEoWudB7q
In the image Add Date & Time is dynamic.
Plz guide me for the same. Thanks
array_merge