Hi,
I can pass an array through jquery ajax.
var regSubCodeArray = new Array();
var temp = 9;
var i;
for(i=0;i<temp;i++)
{
subname = 'sub'+i;
subcode = 'sub_code'+i;
subcredit = 'sub_credit'+i;
regSubCodeArray[i] = document.getElementById(subcode).innerText;
}
$.ajax({
url: "testArray.php",
type: "GET",
data: "page="+regSubCodeArray,
cache: false,
success: function (html) {
$('#ttl').html(html);
}
});
In 'testArray.php', i did the following
echo $_GET['page'];
It prints all the data of the array. But i want to access each data using some foreach loop in my testArray.php page.
Can any-one help me??