I have an HTML form with checkboxes for day option much like the ones indicated below:
<input type="checkbox" name="A" value="Daily">Daily<br>
<input type="checkbox" name="B" value="Sunday">Sunday<br>
<input type="checkbox" name="C" value="Monday">Monday<br>
I then successfully read the checked in boxes in this way:
if (isset($_POST['A']))
$val[] = $_POST['A'];
if (isset($_POST['B']))
$val[] = $_POST['B'];
if (isset($_POST['C']))
$val[] = $_POST['C'];
I then successfully implode them like below:
$value = implode(', ', $val);
I would like some advice on how to insert each array element into a table so that they end up on each row, as displayed in the below table (day column). This table below indicates that the checked in days were Daily, Tuesday, & Tuesday.
+---------+----------------+
| id | day |
+---------+----------------+
| 1 | Daily |
| 2 | Tuesday |
| 3 | Friday |
+---------+----------------+
Any help is appreciated. Looking forward to your advise.