<?php
header("Content-Type: application/json; charset=UTF-8");

$file = __DIR__ . "/database.json";

// kosongkan database
file_put_contents($file, json_encode([], JSON_PRETTY_PRINT));

echo json_encode([
    "ok" => true,
    "message" => "Database berhasil dikosongkan"
]);