A way that this can be done is with JSON.
It turns your array into a single string which is easily passed in AJAX and at the other end you can convert it back to an array.
See here:
JSON[
^], for a start.
JSON is very well established and works with javaScript (your client side), php (server side) and even SQL. Among others.