if you're using ajax to post, and your JavaScript code looks like this:
<code>
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "something.php", true);
xhttp.setRequestHeader("Content-Type", "application/json");
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
// do something
}
};
var data = {some: "thing"};
xhttp.send(JSON.stringify(data));
</code>
then in <code>something.php</code> you can retrieve your json by doing
<?php
$data = json_decode(file_get_contents("php://input"), true);
?>