Hello, I have a form that has several checkboxes. It looks similar to this:
<input name="service_needed[]" type="checkbox" value="service1" class="checkbox" />
<input name="service_needed[]" type="checkbox" value="service2" class="checkbox" />
<input name="service_needed[]" type="checkbox" value="service3" class="checkbox" />
I'm trying to store the values of whichever boxes are checked inside of one variable so that I can use that variable in the mail(); function.
I know I have to use a foreach to print them out similar to this:
foreach ($_POST['service_needed'] as $Services) {
echo $Services;
}
....But then how I do store what the loop prints out inside of a variable? If I use $Services, it only gives me the last checkbox checked value. I need all boxes values that are checked stored inside of one variable.
Thanks for any help.