<form id="myform">
<input type='checkbox' name='foo[]' value='1'>
<input type='checkbox' name='foo[]' checked='true' value='2' >
<input type='checkbox' name='foo[]' value='3' >
<input type='checkbox' name='foo[]' checked='true' value='4' >
</form>
now using jquery, i need to get selected values of name foo[].
Also i need to pass these as an array to a php file i.e foo = array(2,4)
Try this
to get the values of each element then covert it to json using