I've read many 'possible duplicates' of this question and have used the code from one of them in this post but I cannot seem to see exactly what this question is asking.
As part of a much bigger project unrelated to PHP or websites I need to obtain the body of a POST request to my shared server. Following the ideas from this SO post I have made a php file in the www folder on the server containing the following
webhook.php
<?php 
error_log("webhook running");
file_put_contents("post.log", print_r($_POST, true));
?>
I then used a third party company to POST a test message to that script on my server, which was received OK, with a 200 response.
The body of that post contained
Body
{
  "events": [
    {
      "id": "EVTESTDCQAHTYRDYM72",
      "created_at": "2021-01-04T12:17:41.536Z",
      "resource_type": "payments",
      "action": "paid_out",
      "links": {
        "payment": "index_ID_1234567"
      },
      "details": {
        "origin": "mycompanys",
        "cause": "payment_paid_out",
        "description": "The payment has been paid out by mycompany."
      },
      "metadata": {}
    }
  ]
}
but the log file on my server contains only
Array
(
)
I'm not a PHP programmer (just do the minimum I need to in order to get the job done) For debugging and development purposes, how should I alter my webhook.php script so that I can see all the data that was sent?
If I can do that then I can probably work out how do do the proper processing on each element, which won't always have the structure above.
 
     
    