I am sure this is a simple question, so I appologize up front.
I have a form with multiple checkbox items. I am passing them like this...
<input type='checkbox' name='food[]' value='apple'> Apple<br><input type='checkbox' name='food[]' value='orange'> Orange<br><input type='checkbox' name='food[]' value='Pear'> Pear
I can display it on the next page doing...
$count=(count($food));
if ($count > 0) {
foreach($food as $item) {
echo $individual;
}
}
It will display fine, but I would like to submit these items into a mysql db as a comma delimited list. Is there a function to convert arrays to list? I have looked on php.net and searched this site, but haven't come across one.
Thanks for any help.
D.