I have a PHP array
$D = array("Key1"=>"Value1","Key2"=>"Value2") etc.
I need to pass this to a PHP script using jQuery AJAX.
What is the best method to do this?
I know that json_encode should work, but not sure how to implement it in the data definition, which is also sending other variables
tried data: {Var1; "Value1", Var2: "Value2", DArray: <?PHP json_encode($D) ?>} (among other things)