# Checkbox array craziness

**URL:** <https://forum.kirupa.com/t/checkbox-array-craziness/326803>\
**Category:** programming\
**Created:** [January 13, 2012, 4:34am UTC](https://forum.kirupa.com/t/checkbox-array-craziness/326803 "2012-01-13T04:34:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pherank](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pherank](https://forum.kirupa.com/u/Pherank)\
**Post date:** [January 13, 2012, 4:34am UTC](https://forum.kirupa.com/t/checkbox-array-craziness/326803/1 "2012-01-13T04:34:26Z")

</div>

In my HTML code I have the following:

```auto

<label for="reference_1" class="labelCheckbox">
          <input tabindex="20" type="checkbox" name="reference_1" id="refertype[]" class="inputCheckbox" value="Rose madder" />
          Rose madder</label>        
        <label for="reference_2" class="labelCheckbox">
          <input tabindex="22" type="checkbox" name="reference_2" id="refertype[]" class="inputCheckbox" value="Cerulean blue" />
          Cerulean blue</label>       
        <label for="reference_3" class="labelCheckbox">
          <input tabindex="24" type="checkbox" name="reference_3" id="refertype[]" class="inputCheckbox" value="Sap green" />
          Sap green</label>       
        <label for="reference_4" class="labelCheckbox">
          <input tabindex="26" type="checkbox" name="reference_4" id="refertype[]" class="inputCheckbox" value="Pompeii Red" />
          Pompeii Red</label>       
        <label for="reference_5" class="labelCheckbox">
          <input tabindex="28" type="checkbox" name="reference_5" id="refertype[]" class="inputCheckbox" value="Pyrrol Crimson" />
          Pyrrol Crimson</label>  
        <label for="reference_6" class="labelCheckbox">
          <input tabindex="30" type="checkbox" name="reference_6" id="refertype[]" class="inputCheckbox" value="Venetian red" />
          Venetian red</label>
      </fieldset>

```

And in my PHP processing script page I access the array this way:

```auto

<?php
      $refertype = implode(',', $_POST['refertype']);
 ?>

```

But I always receive an error for that line of code unless I comment it out -  
Warning: implode() [function.implode]: Invalid arguments passed in /home/content/56/8666756/html/\_test/forms/scripts/php/process-ifpp-form.php on line 48

Changing the name of the ‘refertype’ variable makes no difference. I even have some other checkbox arrays set up in exactly the same manner, and they all work. So what am I doing wrong here?
