Save tasks in JSON pretty print, and fixed todo.html addtask()
This commit is contained in:
parent
a701c2974c
commit
34e0f341ef
4 changed files with 34 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
// Load tasks from the flat-file database (tasks.txt)
|
||||
$tasks = file_exists("tasks.txt") ? explode("\n", file_get_contents("tasks.txt")) : [];
|
||||
// Load tasks from the flat-file database (tasks.json)
|
||||
$tasks = file_exists("tasks.json") ? json_decode(file_get_contents("tasks.json")) : [];
|
||||
echo json_encode($tasks);
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue