I am writing some simple PHP to receive a POST from another system with a JSON payload. That request is Content-Type: application/json.
I'm simply attempting to dump the json into a txt file as a starting point, but that isn't happening. Here's the PHP file, any suggestions/corrections would be much appreciated!
<?php
ini_set("display_errors", "On");
session_start();
$raw_json = file_get_contents('php://input');
$cooked_json = json_decode($raw_json);
$myfile = fopen('/home/wgordon/log.txt','a');
$fp = fwrite($myfile, $cooked_json);
fclose($myfile);
?>