i have a little confusion while assigning a jquery array to php array, i have multiple checkboxes on a page, i want to assign its value on their click event, i retrieve values perfectly, but fails to assign to php array, here is my code during testing, finally i want it to assign to php session after working:
function updateSession() {
var allVals = [];
<?php $ids = array()?>
$('#c_b :checked').each(function() {
allVals.push($(this).val());
<?php $ids ?> = allVals;
});
// i am testing here in alert!
alert(<?=$ids?>);
}
$(function() {
$('#c_b input').click(updateSession);
updateSession();
});
};
Many thanx in advance!