make an array from checkbox values PHP
<p>I've many check-boxes. I'd like to pull their values into a comma separated array.
If checkbox is diselected value will be empty so:</p>

<p>bar,parking,,,,,tv,etc</p>

<p>how would I do this? after making an array I will submit into a db.</p>

<pre><code>    &lt;p&gt;
        &lt;label for="meta_box_check_bar"&gt;bar&lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_bar" name="meta_box_check_bar" value="bar" /&gt;

        &lt;label for="meta_box_check_parking"&gt;parking&lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_parking" name="meta_box_check_parking" value="parking" /&gt;

        &lt;label for=""&gt;accessible-for-disabled&lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_accessible-for-disabled" name="meta_box_check_accessible-for-disabled" value="accessible-for-disabled" /&gt;

        &lt;label for=""&gt;air-conditioning&lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_air-conditioning" name="meta_box_check_air-conditioning" value="air-conditioning" /&gt;

        &lt;label for=""&gt;frigobar &lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_frigobar" name="meta_box_check_frigobar" value="frigobar" /&gt;

        &lt;label for=""&gt;pets&lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_pets" name="meta_box_check_pets" value="pets" /&gt;

        &lt;label for=""&gt;phone&lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_phone" name="meta_box_check_phone" value="phone" /&gt;

        &lt;label for=""&gt;tv&lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_tv" name="meta_box_check_tv" value="tv" /&gt;

        &lt;label for=""&gt;typical-local-dishes&lt;/label&gt;
        &lt;input type="checkbox" id="meta_box_check_typical-local-dishes" name="meta_box_check_typical-local-dishes" value="typical-local-dishes" /&gt;
    &lt;/p&gt;
</code></pre>
