diff --git a/script.log b/script.log new file mode 100644 index 0000000..f68bfc4 --- /dev/null +++ b/script.log @@ -0,0 +1 @@ +2025-12-12T06:34:25+00:00 | Daniel | amount=250 | vat=47.5 | total=297.5 diff --git a/script_php.php b/script_php.php new file mode 100755 index 0000000..33a60bb --- /dev/null +++ b/script_php.php @@ -0,0 +1,45 @@ +#!/usr/bin/env php + $name, + "amount" => $amount, + "vat" => $vat, + "total" => $total, + "time" => date("c"), +]; + +echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . PHP_EOL; + +// scrie și un log local +$logLine = $result["time"] . " | {$name} | amount={$amount} | vat={$vat} | total={$total}\n"; +file_put_contents(__DIR__ . "/script.log", $logLine, FILE_APPEND);