Data not received on server in ajax
$_POST is:


  An associative array of variables passed to the current script via the HTTP POST method when using application/x-www-form-urlencoded or multipart/form-data as the HTTP Content-Type in the request.


That's not what you're doing. To receive JSON data in PHP you need to use:

$data = json_decode(file_get_contents('php://input'), true);
print_r($data);


Or change the data type of your AJAX request to one of the values that will result in $_POST being populated.