I have a form where I've got three checkboxes like this:
<td>Wireless <input type="checkbox" name="services[]" value="wireless" /></td>
</tr>
<tr>
<td>Cellular <input type="checkbox" name="services[]" value="cellular" /></td>
</tr>
<tr>
<td>Security <input type="checkbox" name="services[]" value="Security" /></td>
<input type="submit" name="submit">
and then I extract($_POST), and have this code
$comServices = implode(",", $services);
but I get an error:
Warning: implode() [function.implode]: Invalid arguments passed in ..
does anyone know why Im getting this error?
If none of your checkboxes was selected $services would be undefined rather than an empty array.
You can do $comServices = implode(",", (array)$services);
to prevent it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With