Hy
You can pass the Array easily with JSON format:
var aray = ["elm1", "elm2", ...];
Then, in php you can use json_decode() function.
About vars, I think you can put them in an JSON object
var vars = {"var1":"val1", "var2":"val2", ...};
Then, in php
Code:
$vars = json_decode($_POST['vars']);
foreach($vars as $k => $v) {
$$k = $v;
}