Leia a matriz associativa de json em $ _POST
Estou usando o jQuery para postar um objeto json no meu aplicativo ph
jQuery.post("save.php",JSON.stringify(dataToSend), function(data){ alert(data); });
A string json como puxada do firebug é assim
{ "data" : [ { "contents" : "This is some content",
"selector" : "DIV.subhead"
},
{ "contents" : "some other content",
"selector" : "LI:nth-child(1) A"
}
],
"page" : "about_us.php"
}
No php, estou tentando transformar isso em uma matriz associativ
Meu código php até agora é
<?php
$value = json_decode(stripcslashes($_POST));
echo $value['page'];
?>
A resposta à chamada ajax deve ser "about_us.php", mas volta em branc