RationalRabbit
asked on
Send PHP array to script via Ajax using jQuery
I have a PHP array
$D = array("Key1"=>"Value1","Ke y2"=>"Valu e2") 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)
$D = array("Key1"=>"Value1","Ke
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)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you welcome
ASKER