I'm looking for a way to post an object of arrays of objects in jQuery to a PHP file, and to decode it.
What I've tried :
jQuery
myTab1[0] = {a: 2, b: 3};
myTab1[1] = {a: 1, b: 1};
myTab2[0] = {a: 42, b: 43};
myTab2[1] = {a: 15, b: 17};
var info = {id: 57,
title: 'myTitle',
tab1: JSON.stringify(myTab1),
tab2: JSON.stringify(myTab2)
};
$.post('save.php', info);
PHP
$tab1 = json_decode($_POST['tab1'])
echo count($tab1); // always 1, whatever myTab1
Have you an idea please ?