xxxxxxxxxx
if($json = json_decode(file_get_contents("php://input"), true)) {
$data = $json;
} else {
$data = $_POST;
}
xxxxxxxxxx
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Retrieve the post data
$post_data = $_POST;
print_r($post_data);
}
?>