jQuery ajax post json type data to php use json_decode example

from:http://stackoverflow.com/questions/2799304/sending-jsonjquery-to-php-and-decoding-it

// JS

var person = “{ name: ‘John Doe’ }"; // notice the double quotes here, this is a string, and not an object
$.ajax({
type: “POST",
url: “../bin/process.php",
dataType: “json",
data: { json: person }
});

// PHP

$json = $_POST[‘json’]; // $json is a string
$person = json_decode($json); // $person is an array with a key ‘name’