Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.