function read_agendas() { if (!file_exists('fileDB')) { mkdir('fileDB'); } if (!file_exists(FILE_PATH)) { global $fixture; write_agendas($fixture); } $result = json_decode(file_get_contents(FILE_PATH), true); return $result; }
function set_agenda($emp_id, $agenda) { $agendas = read_agendas(); $agendas[$emp_id] = $agenda; write_agendas($agendas); }