In javascript i am using JSON.stringify it generate the below string
{"grid":[{"section":[{"id":"wid-id-1-1"},{"id":"wid-id-1-4"}]},{"section":[{"id":"wid-id-1-5"}]},{"section":[{"id":"wid-id-1-2"},{"id":"wid-id-1-3"}]}]}
i am calling php using ajax, i can get the string in PHP as it is, but after that how i should process it.
Below is my full code
var mainArr = [];
$('.sortable-grid')
.each(function() {
var subArr = [];
$(this)
.children('.mygrid')
.each(function() {
var subObj = {};
subObj['id'] = $(this)
.attr('id');
subArr.push(subObj);
});
var out = {
'section': subArr
};
mainArr.push(out);
});
var storePositionObj = JSON.stringify({
'grid': mainArr
});
$.ajax({
url: __BASEURL + "php/update-details.php",
data: {position: storePositionObj},
I recently started learning PHP, and don't know how to process this above string.
could any one please help.
thank you
regards, Mona