<input type="checkbox"name="travel[]" value="bus"/>
<input type="checkbox"name="travel[]" value="train"/>
<input type="checkbox"name="travel[]" value="plane"/>
foreach($_POST['travel']as $selected)
var select[]=$selected;
If the user selects all the three checkboxes, I have to store them in an array and send it to mail as I dont have a data base. So how should I store them in an array?
foreach($_POST['travel']as $selected)
var select[]=$selected;
The above code is returning only last selected check box And how should I pass it and display it on the mail?
$_POST['travel']is already an arrayforeachbecause your$_POST['travel']is itself an array with that 3 selected value use that directly.thanks.var select = implode(",",$_POST['travel']);now you get the value using{{select}}in mail template its returnsbus,train