How can I write into existing JSON-file the data from backend-Formular in Typo3 directly? And how can I later delete some data from JSON, when I delete them from the backend in Typo3? All JSON enterings have a time stamp.
Thank you in advance!
How can I write into existing JSON-file the data from backend-Formular in Typo3 directly? And how can I later delete some data from JSON, when I delete them from the backend in Typo3? All JSON enterings have a time stamp.
Thank you in advance!
as JSON, is not a linear file Format but rather a Serialized object. its not possible to append data to it.
what you have to to is:
1) read the json file 2) use
json_decode()to get an stdObject or array 3) manipulate that data Object/array the way you want. 4) usejson_encode()to convert it back to a string.. 5) write it back to a file.