Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 24, 2020 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/343fc2c2272fe6f50e6aecf55be26277 to your computer and use it in GitHub Desktop.
Save parzibyte/343fc2c2272fe6f50e6aecf55be26277 to your computer and use it in GitHub Desktop.
<?php
$data = json_decode(file_get_contents("php://input"));
# Prepare the data
$date = date("Y-m-d H:i:s");
$value = $data->value;
$another_value = $data->another_value;
$data = sprintf("On %s the data is %s and another_value is %s\n", $date, $value, $another_value);
# Save it
file_put_contents("data_post.txt", $data, FILE_APPEND);
# And we need to answer the client. We just tell the date ;)
echo $date;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment