0

I have a json file on my server and need to access it from my app. The app is set up so that it should download the images that the json contains(just the URL's are inside the json) when a new version of this file is available however.

The problem that i'm having is, that I'm not sure what is the best way to get this version of the json file. Should I download the file everytime I need to check just the version? I thought I could make a php script that would just return the version of the json file however, I do not know how I would get on to make such a script since i don't know a lot about PHP.

Tl:DR What is the best way to get the version of a json file by downloading the whole file and parsing it in the app or creating a PHP script that returns just the version. If its the latter how would I create such a PHP script?

Thanks in advance -Jorge

J.Paravicini
  • 882
  • 12
  • 39
  • If you going to change json structure on every new version, it is recommended that you keep version information in json file, and download json file everytime. if you want simple php script to send , create file `get_version.php` and put below code `1.0)); ?>` put the file on server and call this url. It will give you version. you can change version in this php file when ever required. – jagad89 Jun 01 '17 at 16:32
  • Thanks a lot, I honestly did not imagine it being so simple. Have a nice day good sir – J.Paravicini Jun 01 '17 at 16:36

0 Answers0