Php webtags: Difference between revisions

511 bytes added ,  07:50, 20 April 2020
m
Line 120: Line 120:
== Option 3: JavaScript Object Notation ==
== Option 3: JavaScript Object Notation ==
This is a lightweight data-interchange format that is easy for humans to read and write, but critically it is easy for machines to parse and generate for transferring the variables in a portable way.
This is a lightweight data-interchange format that is easy for humans to read and write, but critically it is easy for machines to parse and generate for transferring the variables in a portable way.
*Cumulus MX has one array per weather variable; each element being a sub-array containing a time-stamp and the value at that time.  Again you may need to choose the interval between such sub-arrays that suits your use in your web pages.


Cumulus MX uses this approach to provide variables for plotting the charts on your web site.
*To have the json files uploaded to your web site, you must enable '''Include standard files''' within the ''Web/FTP settings'' section of '''Internet Settings'''.
*Cumulus MX has one json file per weather chart
* Within each json file there is an array defined; each element of that array being a sub-array containing a time-stamp and the value at that time.
*The interval between sub-arrays depends on the chart, for daily rain and daily temperature there is a sub array for each day; but for most there is a sub-array for every minute (assuming Cumulus is left running for long enough) for a full 24 hours.


The single file idea of the second choice above might use approach option 1 or option 2, the latter is described further below.
If you want to set up your own json files, you may follow the same approach but need to choose the interval between such sub-arrays that suits your use in your web pages.


=Option 2 - implementation details=
=Option 2 - implementation details=
5,838

edits