Without further ado, let’s just give you the code:
http://code.jquery.com/jquery-1.7.2.min.js">>
$data = $_POST['data'];
$arr = json_decode($data);
var_dump($arr);
$a = array(1,2,3,4);
foreach($a as $v){
?>
}
?>
<script><br>
$('.but_delet_choice').click(function(){<br>
//Get checkboxes other than all selections<br>
var $check_boxes = $("input[name='checkbox']:checked");<br>
if($check_boxes.length<=0){<br />
alert('You have not checked, please check!');<br />
return;<br />
}<br />
var array = new Array();<br />
$check_boxes.each(function(){<br />
var array_push = new Array();<br />
array_push.push($(this).val());<br />
array_push.push(2);<br />
array.push(array_push);<br />
})<br />
$.post(<br />
'test1.php',<br />
{<br />
data: JSON.stringify(array)<br />
}<br />
);<br />
return false;<br />
});<br />
</script>
array(4) {
[0]=>
array(2) {
[0]=>
String(1) "1"
[1]=>
int(2)
}
[1]=>
array(2) {
[0]=>
String(1) "2"
[1]=>
int(2)
}
[2]=>
array(2) {
[0]=>
String(1) "3"
[1]=>
int(2)
}
[3]=>
array(2) {
[0]=>
String(1) "4"
[1]=>
int(2)
}
}
This is just a simple implementation to give you a reference. Friends can expand freely.