I have a complicated problem here and after months of research, I still couldn't find a more convenient way of doing this.
I have a website that reads JSON text files and displays the info from that JSON file to the webpage as table. The JSON file contains fields such as date, action, user, etc.
The way I currently do it is I added a File Upload HTML tag so the user can select the JSON file to read. I have no choice but to do File Upload as I see no other ways but I'd really prefer not to upload these files to the server, I just need to read the contents. Anyway, after uploading the file and reading the contents into a variable, I then have to store these files to MySql database just so I can sort them by date, I have to be able to display the table sorted by date.
I have 2 questions;
- Is there any other way to read text file contents without uploading the file to read?
- Is there some sort of simple way to sort an array (by date)?