I am trying to get ajax array data on PHP side. but I'm having trouble getting the values in PHP. Here's my JavaScript code:
console.log(obj);
$.ajax({
method: 'POST',
url: '/inc/sort_answers.php',
data: obj,
success: function(data) {
if ( data.indexOf('success') != -1) {
window.onbeforeunload = null;
location.replace('/sort-results/');
} else {
alert(data);
}
},
And output of this js code is:
I am using this code to get values in PHP:
$unsorted = json_decode(stripslashes($_POST['unsorted']));
But it gives me an error.

objvariable, instead of an image of its console representation