I think this should be very simple, but I'm having problems as usual...
I want to build an array from checkboxes on a form. My form looks like this:
on checking the boxes and submitting the form back to the same page with submit button value "listfruits":
the result returned is "array", not "apples, pears" as I expected...
I want to build an array from checkboxes on a form. My form looks like this:
Code:
<input name="fruit1" type="checkbox" id="fruit1" value="apples" />
Apples
<input name="fruit2" type="checkbox" id="fruit2" value="pears" />
Pears
on checking the boxes and submitting the form back to the same page with submit button value "listfruits":
Code:
if (isset($_REQUEST['listfruits'])) {
$fruits = array('fruit1', 'fruit2');
echo "$fruits";
}
the result returned is "array", not "apples, pears" as I expected...