I passed an array using Ajax and i echoed it in php , it works good. But i don't know how to separate its value and find its length.
Here is the code:
var myCheckboxes = new Array();
$(".book_type:checked").each(function() {
myCheckboxes.push($(this).val());
});
$.post("s.php?c="+category+"&k="+myCheckboxes,{data : "some data"}, function(response){
$("#show_result").html(response);
And the php is:
$a=$_GET['k'];
echo $a;
it displays the values of all checkbox like this
all,0,1,2,3,4
How can i find $a length as array?. if i use sizeof($a) it shows as 1.
Also how to separate those values into each single value.
Any suggestion