I’m passing data to a jquery/ajax that in turns pass the data to a php program. this works fine when i post singular values, but i cannot get it to work when passing an array of data, i need to know how I can capture the array of data and pass on as an array.
A typical solution these days is to use JSON to return arrays to a JS script, to do this in your PHP script use [B]json_encode/B like the example below
echo json_encode(array());
exit;
In your $.[B]ajax/B source add the method dataType and the value json which would look like the example below
$.ajax({
dataType: 'json'
});
Then in your success function you should be able to simply call the array values using
I have tried this, but it won’t work. when I add the dataType: “json”, my jquery form wont even submit. I have the latest jquery lib. Is there any other way to do this? Is it not possible to loop through my array when posted to my jquery/ajax than somehow pass it back to my php as an array so I can process it?