- Joined
- Feb 1, 2021
- Messages
- 4
- Reaction score
- 0
Hi, I have JSON data being pulled through from an API which is obviously in the horrible JSON format and practically unreadable, so I need to have it put into an HTML table. I've seen various methods for doing this but haven't found any that work. The problem is it isn't static data, it changes depending on what the user is searching for, so the examples containing static JSON data aren't of any use to me.
So in a PHP script I pulled through the JSON data, which I can then also create a file from (I've looked in the file and it contains the data so that all seems to work)
But then I need a way (using some JQuery or Javascript I guess) for that resulting .json file to be read and the data to be put into a HTML table. Anyone know a simple way I can do this?
So in a PHP script I pulled through the JSON data, which I can then also create a file from (I've looked in the file and it contains the data so that all seems to work)
Code:
$result = curl_exec($ch);
$fp = fopen('result.json', 'w');
fwrite($fp, $result);
But then I need a way (using some JQuery or Javascript I guess) for that resulting .json file to be read and the data to be put into a HTML table. Anyone know a simple way I can do this?