View Single Post
Old 03-01-2011, 12:07 PM   PM User | #2
MarPlo
Regular Coder

 
Join Date: Mar 2011
Posts: 145
Thanks: 0
Thanked 20 Times in 20 Posts
MarPlo is an unknown quantity at this point
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;
}
MarPlo is offline   Reply With Quote