选中复选框,不使用$ _POST foreach发送值

I have a PHP mailer form with this in the code:

foreach ($_POST as $key => $value) {
    $querydetails = $querydetails  . '<li>' .  $key . ': ' . $value . ' </li>';
}

Simple right? Works as normal for text inputs but not checkboxes.

I have this for the checkboxes in the form:

<input type="checkbox" name="fsfnew" value="I'd like x!">
<input type="checkbox" name="fsfused" value="I need y!">

If I check just one checkbox, both keys get sent through, but no value.

If I check no checkboxes, I get both keys sent through without values.

If I check all checkboxes, I get both keys sent through without values.

This should be simple, and I have been at it for hours and can't work it out.

You should use an HTML table for checkboxes.

<input type="checkbox" name="myCheckboxArray[]" value="I'd like x!" />
<input type="checkbox" name="myCheckboxArray[]" value="I need y!" />

And then in your php file:

if (isset($_POST['myCheckboxArray'] && is_array($_POST['myCheckboxArray']) {
    foreach ($_POST['myCheckboxArray'] as $key) {
        //do something
    }
}