Php webtags: Difference between revisions

m
== 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.
*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.
 
*CumulusIf MXyou haswant oneto arrayset perup weatheryour variable;own eachjson elementfiles, beingyou amay sub-array containing a time-stamp andfollow the valuesame atapproach that time. Again you maybut need to choose the interval between such sub-arrays that suits your use in your web pages.
The single file idea of the second choice above might use approach option 1 or option 2, the latter is described further below.
 
=Option 2 - implementation details=
5,838

edits