Jump to content

Load file to array. 1 line per value.


ttocskcaj

Recommended Posts

I have a local text file with several lines of json data. (Each line is different).

Is there any way to load this file into a var?

That way I can decode each set of json like var[0], var[1] etc.

The json data in the text file is updated every minute by a python script.

Link to comment
https://forums.phpfreaks.com/topic/237314-load-file-to-array-1-line-per-value/
Share on other sites

Zanus, I want to do it in javascript. That's a php function. Unless there is a way to pass a php variable to javascript?

I guess I could load it with php, and put it in a hidden div?

I'm using jquery, so it's just part of the document ready function.

The JSON in the file contains a list of online players in a server, and this list is shown in a hover box.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.