Code:
<!doctype html>
<head>
</head>
<body>
<script>
myArray=[];
myArray[0]="zero";
myArray[1]="one";
req=new XMLHttpRequest;
req.open("post","arrayto.php",true)
req.onreadystatechange=function(){
if (req.readyState==4){
alert(req.responseText)
}
}
params='myArray='+myArray;
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
req.setRequestHeader("Content-length", params.length);
req.setRequestHeader("Connection", "close");
req.send(params);
</script>
</body>
</html>
on the server ...
$myArray=explode(",",$_POST["myArray"]);
echo "Got it";