]>
Commit | Line | Data |
---|---|---|
b5c89dfb | 1 | <?php |
2 | $db = json_decode(file_get_contents("modules/trivia.json"), TRUE); | |
3 | $fh = fopen('qs.txt', 'r'); | |
4 | foreach (file('qs.txt') as $line) { | |
5 | list($q, $a) = explode('*', trim($line), 2); | |
6 | $db['questions'][] = array('question' => $q, 'answer' => trim($a)); | |
7 | } | |
8 | file_put_contents('modules/trivia.json', json_encode($db)); |