I have an external PHP include script that polls my database and results in an array that I json encode and parse on as a variable $final
.
The last line of that code is $final = json_encode($dataset1,JSON_NUMERIC_CHECK);
The echoed output of that looks like [[1,7],[2,10],[3,10]]
.
I am using this data to populate a dynamic Ajax Flot line plot showing listeners on my radio station at one minute intervals.
However, and here is my question... I also want to display a single integer value on my web page, for the last item (y value) in the array. For the example above 10
. e.g. Number of listeners: 10
Furthermore I would like to use the Ajax sweep, which updates the array to dynamically update this integer.
For further context, including the ajax here is the code that results in the array, and ajax updated chart.
I only include this because I want to make use of the Ajax/Variables already being used.