<?php
// Load tasks from the flat-file database (tasks.txt)
$tasks = file_exists("tasks.txt") ? explode("\n", file_get_contents("tasks.txt")) : [];
echo json_encode($tasks);
?>