In order to properly process JSON encoded POSTs in PHP, one has to read the raw contents of the POST by fetching the contents of php://input, and subsequently parse the incoming data from JSON to a PHP object.


Sample script:


<?php
$json = file_get_contents('php://input');
$obj = json_decode($json);